android布局之线性布局
来源:互联网 发布:房产中介辅助软件 编辑:程序博客网 时间:2024/06/05 18:01
LinearLayout 线性布局有两种,分别是水平线性布局和垂直线性布局,LinearLayout属性中android:orientation为设置线性布局当其="vertical"时,为 垂直线性布局,当其="horizontal"时,为水平线性布局,不管是水平还是垂直线性布局一行(列)只能放置一个控件。
下面我们举例说明:
垂直线性布局
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <EditText android:layout_width="100dp" android:layout_height="wrap_content" /> <Button android:layout_width="100dp" android:layout_height="wrap_content" android:text="Button1"/> <Button android:layout_width="100dp" android:layout_height="wrap_content" android:text="button2"/></LinearLayout>
水平线性布局:
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal" > <EditText android:layout_width="100dp" android:layout_height="wrap_content" /> <Button android:layout_width="100dp" android:layout_height="wrap_content" android:text="Button1"/> <Button android:layout_width="100dp" android:layout_height="wrap_content" android:text="button2"/></LinearLayout>
运行结果:
这两种线性布局唯一的差别就是android:orientation的值不同,垂直线性布局的值为vertical ,水平线性布局的值为"horizontal"
- android布局之线性布局
- android布局之线性布局
- Android布局之线性布局
- Android布局之线性布局
- android布局之线性布局
- Android布局之线性布局
- Android之线性布局
- 【Android】界面布局之 LinearLayout(线性布局)
- Android布局之LinearLayout(线性布局)
- Android布局之LinearLayout(线性布局)
- Android布局之Linearyout(线性)布局
- Android 中的布局方式之线性布局
- Android布局之LinearLayout(线性布局)
- android布局之线性布局(LinearLayout)
- 1.Android之布局LinearLayout(线性布局)
- android布局之Linearlayout(线性布局)
- Android学习-五布局之线性布局
- Android入门之线性布局
- 红黑树的经典讲解
- virtualbox 虚拟机静态IP设置(用于Host Only和NAT共存的方式)
- UVC驱动抓图测试程序--基于V4L2
- 重复执行sql语句前的判断参考-仅供自己备忘参考
- UDP通讯(客户端)
- android布局之线性布局
- linux命令
- Android----用HTTP的get,post,HttpClient三种方式向web service提交文本数据
- 分治算法
- Linux 调度器内幕
- 动态规划
- 贪心算法
- 空间不确定性分析
- Linux:grep