Android 新手入门(2)-界面布局
16lz
2021-01-23
一,线性布局(LinearLayout)
以线性方向显示它的子视图(view)元素,垂直或水平,
android:orientation值为“vertical”垂直排列,"horizontal"即为水平排列,
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <Button android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/button1" android:text="线" ></Button> <Button android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/button2" android:text="性" ></Button> <Button android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/button3" android:text="布" ></Button> <Button android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/button4" android:text="局" ></Button> </LinearLayout>
更多相关文章
- android 水平(左右)滚动 HorizontalScrollView
- Android中TextView如何实现水平和垂直滚动
- Android控制水平方向字体缩放android:textScaleX
- Android四大布局之线性布局及其属性
- android线性布局控件之间的距离设置
- android中空的view,可以设置为水平线
- android的布局水平与垂直显示
- Android Studio App设置线性布局LinerLayout控件占屏幕长宽比例
- 【Android】线性布局和相对布局的比较