Android:根据屏幕尺寸改变方向
如果屏幕足够大,我需要我的某些活动才能更改为横向。
这意味着屏幕尺寸为 5.1 英寸以上的平板电脑和手机。
无论如何,是否可以通过重写 onConfigurationChanged(...) 并使用 XML 语句来做到这一点:
android:configChanges="orientation"
I need certain activities of mine to only change to landscape if the screen is big enough.
This means tablets and phones with screen size 5.1in+.
Is there anyway to do this through overriding onConfigurationChanged(...) and using the XML statement:
android:configChanges="orientation"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你当然可以。您可以嗅探屏幕尺寸,并使用 if 语句 if 二进制或开关来手动设置视图的方向:
You certainly can. You can sniff for the screen size and using an if statement if binary or a switch otherwise to set the orientation of the view manually: