Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enable landscape mode for iPad/tablet using react-native

I am working on a requirement where the mobile device would support only portrait mode while the tablet/iPad supports both portrait and landscape mode, I am not sure how to achieve the requirement using react-native

like image 621
Saikat Saha Avatar asked Jun 29 '20 02:06

Saikat Saha


1 Answers

For iOS, including the following lines in the ios/Info.plist file should do it:

<key>UISupportedInterfaceOrientations</key>
<array>
    <string>UIInterfaceOrientationPortrait</string>
</array>

<key>UISupportedInterfaceOrientations~ipad</key>
<array>
    <string>UIInterfaceOrientationLandscapeRight</string>
    <string>UIInterfaceOrientationLandscapeLeft</string>
    <string>UIInterfaceOrientationPortrait</string>
    <string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
like image 63
Hans Bouwmeester Avatar answered Oct 27 '22 10:10

Hans Bouwmeester