Android开发笔记之Linear Layout
来源:互联网 发布:什么是多态java 编辑:程序博客网 时间:2024/04/27 09:29
LinearLayout是线性布局控件,它包含的子控件将以横向或竖向的方式排列,按照相对位置来排列所有的widgets或者其他的containers,超过边界时,某些控件将缺失或消失。因此一个垂直列表的每一行只会有一个widget或者是container,而不管他们有多宽,而一个水平列表将会只有一个行高(高度为最高子控件的高度加上边框高度)。LinearLayout保持其所包含的widget或者是container之间的间隔以及互相对齐(相对一个控件的右对齐、中间对齐或者左对齐)。
android:id —— 为控件指定相应的ID
android:text —— 指定控件当中显示的文字,需要注意的是,这里尽量使用strings.xml文件当中的字符串
android:grivity —— 指定控件的基本位置,比如说居中,居右等位置
android:textSize —— 指定控件当中字体的大小
android:background —— 指定该控件所使用的背景色,RGB命名法
android:width —— 指定控件的宽度
android:height —— 指定控件的高度
android:padding* —— 指定控件的内边距,也就是说控件当中的内容
android:sigleLine —— 如果设置为真的话,则将控件的内容在同一行当中进行显示
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <!-- android:id —— 为控件指定相应的ID android:text —— 指定控件当中显示的文字,需要注意的是,这里尽量使用strings.xml文件当中的字符串 android:grivity —— 指定控件的基本位置,比如说居中,居右等位置 android:textSize —— 指定控件当中字体的大小 android:background —— 指定该控件所使用的背景色,RGB命名法 android:width —— 指定控件的宽度 android:height —— 指定控件的高度 android:padding* —— 指定控件的内边距,也就是说控件当中的内容 android:sigleLine —— 如果设置为真的话,则将控件的内容在同一行当中进行显示 --><TextViewandroid:id="@+id/firstText"android:text="第一行"android:gravity="center_vertical"android:textSize="5pt"android:background="#aa0000"android:layout_width="fill_parent"android:layout_height="wrap_content"android:layout_weight="1"android:textColor="#000000" android:singleLine="true"/><TextViewandroid:id="@+id/secondText"android:text="第二行"android:gravity="center_vertical"android:textSize="15pt"android:background="#0000aa"android:layout_width="fill_parent"android:layout_height="wrap_content"android:layout_weight="1"/></LinearLayout>
- Android开发笔记之Linear Layout
- Android: Linear Layout and weight
- Android线性布局(Linear Layout)
- Android API Guides---Linear Layout
- Android线性布局(Linear Layout)
- Android开发系列之Layout&Layout属性
- Android开发教程 --- 布局(线性布局 Linear Layout )(相对布局 Relative Layout)
- android学习笔记之layout
- Android开发之layout布局
- android开发之二layout
- Linear Layout
- Linear Layout
- Linear Layout
- Android布局之一——Linear Layout
- Android UI学习 - Linear Layout, RelativeLayout
- Android UI学习 - Linear Layout, RelativeLayout
- Android布局---线性布局(Linear Layout)
- android开发之android-layout-finder-tools
- 大学生活应该这样度过之参加一个社团让自己溶入团队——《程序员羊皮卷》连载(11)
- 程序员考核的五大死因(上)
- 程序人生 zz 文章老了点 以前一些程序人的经历
- 蒋涛作序盛赞Leo新作为“程序员职场实用百科全书”——《程序员羊皮卷》连载(1)
- Shell 基本语法
- Android开发笔记之Linear Layout
- 编程高手箴言
- 腾讯QQ Web Service 接口
- 一个老程序员的成长道路
- 高级程序员如何面对职场压力?(2)--受伤的总是我
- 什么是程序员正确的职场心态?
- 公司技术管理角度看C++游戏程序员发展
- 周鸿祎,高司令
- 中国智慧VS西方智慧-看中国IT风云与IT产业怪状