Pedram Pedram - 1 month ago 9
iOS Question

Rotation locking in Xcode doesn't work with React Native on an iPad

I'm trying to limit my app to only landscape rotation, so I do the following in XCode:

enter image description here

That seems to work when running on an iPhone simulator (tested 6 and 7), but not on an iPad simulator (tested Pro and Retina). I also tested on a physical iPad Air 2 and it rotates as well.

Is there any way I can get it to work on an iPad without having to use something like react-native-orientation? I'm using React Native 0.34.0.

Answer

I'm not sure if it's a bug in Xcode, but it doesn't seem to work on an iPad if the device is set to Universal. I changed it to iPad then it works fine.

enter image description here