简体   繁体   English

当设备处于纵向=屏幕上的可见旋转时,平板电脑上的锁定横向方向+活动开始

[英]Locked landscape orientation on tablet + activity started when device in portrait = visible rotation on screen

I have an activity with locked orientation (setRequestedOrientation in OnCreate). 我有一个锁定方向的活动(OnCreate中的setRequestedOrientation)。 It works fine on the phone and almost fine on the tablet. 它在手机上工作正常,在平板电脑上几乎没问题。

The problem I have is with honeycomb tablets (motorola xoom and samsung), when activity is started when the user holds the device in portait mode, the activity is initially displayed in portait and then after a fraction of a second it rotates to landscape. 我遇到的问题是蜂窝平板电脑(motorola xoom和samsung),当用户将设备保持在肖像模式时开始活动,活动最初显示在portait中,然后在几分之一秒后旋转到横向。 Is there any way to stop it from happening? 有没有办法阻止它发生?

Try to preset it in AndroidManifest.xml: 尝试在AndroidManifest.xml中预设它:

<activity android:name=".MyActivity" 
              ...
              android:screenOrientation="landscape" 
              />

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 当设备方向从纵向更改为横向时,活动进入循环 - Activity going in loop when device orientation is changed from portrait to landscape 如何检测Android设备是纵向还是横向锁定 - How to detect whether Android device is locked in portrait or landscape orientation 在设备旋转Android上查看横向活动时出现黑屏 - Black screen when opining landscape activity on device rotation android 活动方向锁定时检测设备方向 - Detect device orientation when Activity orientation is locked 启用设备屏幕旋转横向或纵向,仅适用于平板设备 by Flutter - Enable Device Screen Rotation Landscape or Potrait, only for Tablet Device by Flutter 需要方向锁定为横向,但旋转为纵向时仍需要通知 - Need orientation locked to landscape, but still need notification when rotated to portrait 如何在活动锁定为纵向模式时检测设备方向更改? - How to detect device orientation changed while activity is locked to portrait mode? 屏幕锁定时活动返回到纵向 - Activity return to Portrait when Screen is Locked 屏幕锁定后禁止活动旋转到纵向模式的更好方法是什么? - A better way to prohibit activity rotation to portrait mode after screen is locked? Android:活动中的屏幕旋转不会切换纵向/横向布局 - Android: Screen Rotation within Activity doesnt switch portrait/landscape layout
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM