Setting the orientation for only 1 fragment in my activity while the rest is in portrait

后端 未结 8 1104
难免孤独
难免孤独 2020-12-05 01:52

My app needs to be in portrait mode so I set it in the manifest by:

android:screenOrientation=\"portrait\"

But I just recently added anothe

8条回答
  •  清歌不尽
    2020-12-05 02:24

    Orientation attribute is per activity so you can declare the orientation for only the activity that contains the fragment so that it is in landscape and the rest of the activities will remain as they are.

提交回复
热议问题