android线性布局LinearLayout实例源代码
来源:互联网 发布:linux pr debug 编辑:程序博客网 时间:2024/06/18 18:29
android源代码之线性布局LinearLayout:
线性布局是所有布局中最常用的类之一,也是RadioGroup, TabWidget, TableLayout, TableRow, ZoomControls类的父类。LinearLayout可以让它的子元素垂直或水平的方式排成一行(不设置方向的时候默认按照垂直方向排列)。
下面看一个LinearLayout的例子:别被例子的长度吓住,仔细看一下其实就是一个LinearLayout中放5个TextView标签而已,TextView相当于Html标签中的Label。
<、?xml version=”1.0″ encoding=”utf-8″?>
<、LinearLayout xmlns:android=”http://android.9tech.cn/”
android:orientation=”vertical”
android:layout_width=”fill_parent”
android:layout_height=”fill_parent”
android:gravity=”center_horizontal”
>
<、TextView
android:layout_width=”fill_parent”
android:layout_height=”wrap_content”
android:text=”给小宝宝起个名字:”
android:textSize=”20px”
android:textColor=”#0ff”
android:background=”#333″/>
<、TextView
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:text=”遥遥是男孩的小名”
android:textSize=”20px”
android:textColor=”#0f0″
android:background=”#eee”
android:layout_weight=”3″
/>
<、TextView
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:text=”瑶瑶是女孩的小名”
android:textColor=”#00f”
android:textSize=”20px”
android:background=”#ccc”
android:layout_weight=”1″
/>
<、TextView
android:layout_width=”fill_parent”
android:layout_height=”wrap_content”
android:text=”海因是男孩的大名”
android:textColor=”#f33″
android:textSize=”20px”
android:background=”#888″
android:layout_weight=”1″
/>
<、TextView
android:layout_width=”fill_parent”
android:layout_height=”wrap_content”
android:text=”海音是女孩的大名”
android:textColor=”#ff3″
android:textSize=”20px”
android:background=”#333″
android:layout_weight=”1″
/>
<、/LinearLayout>
- android线性布局LinearLayout实例源代码
- android线性布局LinearLayout源代码
- Android 线性布局:LinearLayout
- Android:线性布局LinearLayout
- Android-LinearLayout线性布局
- Android LinearLayout 线性布局
- Android 布局LinearLayout(线性布局)
- Android--LinearLayout(线性布局)
- Android初试--LinearLayout(线性布局)
- Android线性布局管理器LinearLayout
- Android UI LinearLayout线性布局
- Android之LinearLayout线性布局
- Android LinearLayout(线性布局)
- Android笔记---LinearLayout线性布局
- Android-线性布局(LinearLayout)
- Android LinearLayout线性布局属性
- 【Android】界面布局之 LinearLayout(线性布局)
- Android布局之LinearLayout(线性布局)
- GridView自增一列
- ARC 项目编译 non-ARC 的文件
- Win7很悬,微软DirectX 12支持Win8.1/Win9
- delphi操作XML
- 十六进制转十进制
- android线性布局LinearLayout实例源代码
- ARM 开发板 与 PC机ubuntu系统 nfs 挂载
- 如何防止接口被恶意访问
- Linux(RedHat,Centos)上scrapy详尽安装笔记
- kafka mq consumer
- android 4.4 来电广播的变化
- DSP28_Sci.h头文件说明1
- enca 转码
- 十进制转十六进制