开发者

Is there any way to force the portrait screen even the hard keyboard is popped?

开发者 https://www.devze.com 2023-01-14 06:38 出处:网络
I specified an activity to be portrait-only in menifest file: <activity android:name=\"mytest\" android:alwaysRetainTaskState=\"true\"

I specified an activity to be portrait-only in menifest file:

<activity android:name="mytest"
              android:alwaysRetainTaskState="true"
              android:windowSoftInputMode="adjustResize|stateAlwaysHidden"
              android:screenOrientation="portrait">

But it won't work on Droid when its hard keyboard is popped out.

Whe开发者_StackOverflown hard keyboard is popped out, the device always renders the layout of the activity in landscape orientation first, then it switches it back to portrait orientation. How can I let the app only render the activity in portrait orientation?

Can anyone help? Thanks.


Try using this in your activity description

android:configChanges="keyboardHidden"
0

精彩评论

暂无评论...
验证码 换一张
取 消