[英]This LinearLayout layout or its RelativeLayout parent is useless; vertical and horizontal orientation
[英]Switch LinearLayout from horizontal to vertical on orientation change
我的应用程序具有各种LinearLayouts,我希望它们在纵向上是垂直的,而在横向上是水平的。 我知道我可以手动跟踪onLayoutChange并在代码中对其进行更改,但这使它们在XML编辑器中更难使用,我不禁感到应该有一种更简单的方法。 我真正想要的是:
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation_when_in_portrait="vertical"
android:orientation_when_in_landscape="horizontal" >
我意识到这并不存在,但是有什么办法可以实现呢? 我不禁想到,我可能缺少用RelativeLayout做到这一点的方法。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.