0
为什么LinearLayout不会在不同的屏幕上重新调整大小?Android用户界面设计
为什么LinearLayout不会在不同的屏幕上重新调整大小?Android用户界面设计
这取决于你如何使用它!
如果您希望自动调整布局大小,您可以为组成LinearLayout
的视图指定weight参数。
例如:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:weightSum="1"
android:orientation="horizontal"
>
<SomeView
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="0.5"
/>
<SomeView
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="0.5"
/>
</LinearLayout>
在这种情况下,你的两个子视图将共享整个水平空间和他们每个人都会乘坐空间的50%。