安卓UI四种基本布局-线性布局

1》线性布局(LinerLayout)

所有的空间在线性上依次排序

android:orientation="vertical"(纵向布局)

 

android:orientation="horizontal"(横向布局)

即使控件在这一行放不下也不会跳转到下一行

layout_weight可以更好地安排空间的大小和分布比例

<EditText
android:id="@+id/e1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="type something"
/>
<Button
android:id="@+id/b1"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="send"/>

 

posted @ 2019-01-23 02:43  王怀宇  阅读(392)  评论(0编辑  收藏  举报