I am working on a project and I need help how to lock landscape orientation on mobile devices. I have applied CSS media properties they let me change the visibility but I want once I am in portrait mode on a webpage it wont allow to change it's orientation infact it would lock whatsoever.
Asked
Active
Viewed 662 times
1 Answers
0
Add android:screenOrientation="landscape" to the activity element in the AndroidManifest.xml. For example:
<activity android:name=".SomeActivity"
android:label="@string/app_name"
android:screenOrientation="landscape">
For more details: Android - disable landscape mode?
-
well thats in manifest file in my case I want to add something in website code like Jquery or Css that wont allow landscape mode to open on android or ios device infact it would disable it. thanks for help – Sannan Aug 20 '15 at 10:22
-
Probably you can't do it. Please refer to [Is it possible to lock the orientation on android through JavaScript?](http://stackoverflow.com/questions/4979375/is-it-possible-to-lock-the-orientation-on-android-through-javascript) – hata Aug 20 '15 at 10:31