In AndroidManifest: Expecting android:screenOrientation=“unspecified”

前端 未结 11 887
隐瞒了意图╮
隐瞒了意图╮ 2021-02-02 04:59

Android Studio 3.6.

I want my app to be always in portrait mode. So in my AndroidMainfest.xml:



        
11条回答
  •  野性不改
    2021-02-02 05:39

    In Android studio 3.6.0 i guess they want the user to handle the orientation and encourage developer to use ViewModel stuff. Let me explain screenOrientation in detail

    android:screenOrientation="portrait"

    will give you error you have to either specify

    android:screenOrientation="fullSensor" or android:screenOrientation="unspecified"

    fullSensor Means either you have ON the "Rotate off" or not it will change the orientation based on you move the phone

    unspecified Means if you have ON the Rotate off then it will stay only in that orientation and if not then it will change the orientation based on you move the phone.

提交回复
热议问题