Quantcast
Channel: Ayyaz Zafar | Freelance Web Developer
Viewing all articles
Browse latest Browse all 28

How to lock screen orientation to portrait or landscape?

$
0
0

This article will show you how to lock screen orientation to one direction.
Environment Details:
– Phonegap Build – cli-5.2.0
– Device: iPhone S5 9.3.2

For locking orientation to portrait add following code into your config.xml:

<gap:config-file platform="ios" parent="UISupportedInterfaceOrientations" overwrite="true">
    <array>
        <string>UIInterfaceOrientationPortraitOmg</string>
    </array>
</gap:config-file>

For Landscape:

<gap:config-file platform="ios" parent="UISupportedInterfaceOrientations" overwrite="true">
   <array>
       <string>UIInterfaceOrientationLandscapeLeft</string>
       <string>UIInterfaceOrientationLandscapeRight</string>
   </array>
</gap:config-file>

Source: https://github.com/phonegap/build/issues/263

The post How to lock screen orientation to portrait or landscape? appeared first on Ayyaz Zafar | Freelance Web Developer.


Viewing all articles
Browse latest Browse all 28

Trending Articles