How to set android show vertical orientation?

前端 未结 3 1557
粉色の甜心
粉色の甜心 2020-12-06 12:39

From following .xml file I set xml to show TabHost but after i run it on emulator it show both both orientation. i want to set it to show only one orientation. How do i do?

3条回答
  •  隐瞒了意图╮
    2020-12-06 12:55

    In the AndroidMainfeast.xml file you will see

    
    
    

    so Add after .MainActivity

    android:screenOrientation="portrait"
    android:configChanges="keyboardHidden|orientation|screenSize"
    

    android:configChanges="" help us to prevent onpause() and OnResume() method when we made rotation.

提交回复
热议问题