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

发布于 2024-12-29 09:16:00 字数 177 浏览 1 评论 0原文

我有一个锁定方向的活动(OnCreate 中的 setRequestedOrientation)。它在手机上运行良好,在平板电脑上也几乎运行良好。

我遇到的问题是蜂窝平板电脑(摩托罗拉 xoom 和三星),当用户以纵向模式握住设备时启动活动时,该活动最初以纵向显示,然后在几分之一秒后旋转到横向。有什么办法可以阻止它发生吗?

I have an activity with locked orientation (setRequestedOrientation in OnCreate). 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. Is there any way to stop it from happening?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

淡写薰衣草的香 2025-01-05 09:16:00

尝试在AndroidManifest.xml中预设它:

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

Try to preset it in AndroidManifest.xml:

<activity android:name=".MyActivity" 
              ...
              android:screenOrientation="landscape" 
              />
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文