How to fix screen orientation to portrait for my whole PhoneGap app

后端 未结 4 720
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-05 09:04

How to configure the Phonegap app to be fixed to only portrait mode, I there any possibility to do it with CSS or JavaScript so that I should be able to get the consistent behav

4条回答
  •  太阳男子
    2021-02-05 09:21

    To fix your orientation in portrait mode just add the below line in your activity tag in AndroidManifest.xml file:

     android:screenOrientation="portrait"
    

    or this in the activity class:

    setRequestedOrientation (ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
    

提交回复
热议问题