Android - Vertical layout only

后端 未结 8 1660
無奈伤痛
無奈伤痛 2021-01-31 07:26

How do I make sure my app is only for vertical layout?

I have tried android:screenOrientation=\"portrait\" but that doesn\'t seem to do the trick.

相关标签:
8条回答
  • 2021-01-31 07:49

    Add android:configChanges="keyboardHidden|orientation" to the activity.

    0 讨论(0)
  • 2021-01-31 07:51

    Put this attribute in layout root:

    android:orientation="vertical"
    

    It may help.

    0 讨论(0)
提交回复
热议问题