Locking the screen to landscape for only one activity

ⅰ亾dé卋堺 提交于 2020-01-07 02:09:06

问题


I have looked around SO and found how to lock my entire application to Landscape by editing the Manifest file. However, this is not what I want.

I want every activity to be locked portrait, except for one, which will be locked to landscape.


回答1:


In your manifest file, find your Activity declaration and use the following:

    <activity
        android:name=".ActivityName"
        android:label="@string/app_name"
        android:screenOrientation="landscape" >
    </activity>


来源:https://stackoverflow.com/questions/13569052/locking-the-screen-to-landscape-for-only-one-activity

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!