在我的活动设置方向只有1片段,其余处于人像 [英] Setting the orientation for only 1 fragment in my activity while the rest is in portrait

查看:113
本文介绍了在我的活动设置方向只有1片段,其余处于人像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序需要在纵向模式,所以我在清单中被设置:

My app needs to be in portrait mode so I set it in the manifest by:

android:screenOrientation="portrait"

不过,我最近刚刚添加的另一个片段(弗拉加),只是外观和功能10倍景观更好。有什么我可以把我的弗拉加里面只是使该片段的景观,同时保持应用程序的纵向或这样做我会添加一些我的其他片段,让他们保留为肖像的休息吗?

But I just recently added another fragment (FragA) that just looks and functions 10x better in landscape. Is there something I can put inside of my FragA to just make that fragment in landscape while retaining the rest of the app in portrait or by doing this will I have to add something to my other fragments to keep them retained as portrait?

推荐答案

定位属性是每个活动,所以你可以声明的方向只包含片段,使其在景观和活动的其余部分将仍然是活动因为它们是

Orientation attribute is per activity so you can declare the orientation for only the activity that contains the fragment so that it is in landscape and the rest of the activities will remain as they are.

这篇关于在我的活动设置方向只有1片段,其余处于人像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆