方向特定值不会改变
我在值和值域文件夹中设置了尺寸值,并将其用作布局的宽度/高度。 我在活动中以编程方式将屏幕方向更改为横向:
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
但布局尺寸不是 value-land 文件夹 dimens.xml 中声明的尺寸。
我怀疑由于方向仅特定于此活动,因此应用程序不提供更新的资源。
有没有办法改变整个应用程序的方向,或者从代码中引用景观资源?
谢谢
I got dimension values set in both values and values-land folders and used as the width/height of a layout.
I change the screen-orientation programmatically to landscape in my activity:
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
but the layout dimensions are not the ones declared in values-land folder dimens.xml.
I suspect that since the orientation is specific just to this activity, the application doesn't provide the updated resources.
Is there a way to change the orientation of the whole application, or reference to the landscape resources from code?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
经过一番研究,我意识到这种行为是正常的。我通过加载不同尺寸的不同布局解决了我的问题。
After some research I realized that this behavior is normal. I solved my problem by loading a different layout with different dimensions.