How to fix layout orientation to vertical?

前端 未结 7 1558
自闭症患者
自闭症患者 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

提交回复
热议问题