How to fix layout orientation to vertical?

前端 未结 7 1484
自闭症患者
自闭症患者 2021-01-31 06:51

How to fix layout orientation to portrait and do not allow changing from portrait to landscape during run time?

相关标签:
7条回答
  • 2021-01-31 07:39

    If you want to fix the orientation of one Activity in your project, you have to open the Manifest.xml and put in the section of parameters of the desired Activity (before the closure of the first tag < activity…> ):

    android:screenOrientation="portrait" if you want VERTICAL fixed orientation

    android:screenOrientation="landscape" if you want HORIZONTAL fixed orientation

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