question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RotateY does not work on ios

See original GitHub issue

Is this a bug report?

Yes.

Have you read the Contributing Guidelines?

Yes.

Environment

Environment:
  OS:  macOS Sierra 10.12.6
  Node:  8.2.1
  Yarn:  0.27.5
  npm:  5.3.0
  Watchman:  4.9.0
  Xcode:  Xcode 8.3.3 Build version 8E3004b
  Android Studio:  Not Found

Packages: (wanted => installed)
  react: 16.0.0-alpha.12 => 16.0.0-alpha.12
  react-native: 0.48.1 => 0.48.1

Steps to Reproduce

  1. create a new react-native app
  2. add this to the style of a view component:
<View style={{transform: [{rotateY: '45deg'}]}} >
...
</View>

Expected Behavior

Correct behaviour is to rotate the view around Y axis, which is what we see in the android build. https://ibin.co/3dkJexd90tBA.jpg

Actual Behavior

it sort of scales in Y axis instead of rotating. looks like the transform attribute in the style is not processed well. https://ibin.co/3dkUu8yBvCE9.jpg

Reproducible Demo

https://snack.expo.io/HJYdqtR2Z

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
ghostcommented, Nov 2, 2017

@thg303 As a work-around, you can specify a perspective value (before the rotation) to get a similar looking result on both Android and iOS. Note that the perspective needs to be applied prior to the rotation to get the correct results. You can play around with the values, but likely somewhere between 500 and 1000 will give you the effect you’re looking for.

Original code:

transform:[ 
  {rotateY: '45deg'}
]

New code:

transform:[
  {perspective: 500},
  {rotateY: '45deg'}
]
1reaction
woowalkercommented, May 29, 2018

yes, and what is more, you must place {perspective: 500} before your transform style, otherwise it still not work, i try it hard…

Read more comments on GitHub >

github_iconTop Results From Across the Web

iOS 8 css rotateY/rotateX element disappe… - Apple Community
I had a similar issue and I fixed it by adding a perspective to the container element. -webkit-perspective: 900000px;. perspective: 900000px;.
Read more >
Mobile Safari not showing CSS transform rotateX and rotateY ...
This is a bug in ios Safari browser. To fix this, surround the box div with another tag. Then move the css: -webkit-perspective:...
Read more >
Mobile Safari not showing CSS transform rotateX and rotateY ...
If there any issues, contact us on - htfyc dot hows dot tech # iOS :MobileSafarinotshowingCSStransformrotateXandrotateYonlyrotateZ # iOS ...
Read more >
rotateY() - CSS: Cascading Style Sheets - MDN Web Docs
The rotateY() CSS function defines a transformation that rotates an element ... the composition of 3D rotations is usually not commutative.
Read more >
CSS transform:rotate iPhone problems
Hello all. I'm having a problem with CSS transform: rotate, specifically on iPhone/touch devices. I've created buttons that rotate on hover, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found