<!--
orientation:vertical:垂直排列 ;
orientation:horizontal;水平排列;
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<!--
match_parent:“填充满”父容器;
wrap_content:包裹内容;
weight:设置控件与控件的之间的比例
-->
<Button
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="1"
android:text="button1"/>
<Button
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="1"
android:text="button2"/>
</LinearLayout>
Android线性布局
最新推荐文章于 2024-04-01 16:13:10 发布