Android中的线性布局(LinearLayout)
来源:互联网 发布:指南针软件使用教程 编辑:程序博客网 时间:2024/06/14 10:40
<?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" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello" />
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello" />
</LinearLayout>
解释上面代码的意思:
<LinearLayout>标签:定义了整个程序显示的布局。
在LinearLayout布局中,android:orientation用于定义布局中子元素的排列方式,布局包含两种排列方式:vertical(垂直排列)和horizontal(水平排列)。
android:layout_width 定义了元素布局的宽度,可以通过三种方式来指定宽度。
1)fill_parent:宽度和父元素相同;
2)wrap_content:宽度随组件本身的内容调整;
3):通过指定px值来设置宽度。
android:layout_height 定义了元素布局的高度,可以通过三种方式来指定高度。
1)fill_parent:宽度和父元素相同;
2)wrap_content:宽度随组件本身的内容调整;
3):通过指定px值来设置宽度。
- Android中的线性布局(LinearLayout)
- Android--LinearLayout(线性布局)
- Android LinearLayout(线性布局)
- Android-线性布局(LinearLayout)
- Android中的LinearLayout(线性布局)设置背景图片
- Android布局之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 gtest 测试框架
- 学习笔记之vi之分页功能
- How to print a PDF file Using VB
- A星(A*, A Star)算法详解
- 舆情分析--ROST虚拟学习团队
- Android中的线性布局(LinearLayout)
- u大师U盘装系统——运行Windows登录密码
- 求某天之后的三个工作日
- Svn命令
- svn diff 和patch的使用
- Linux system函数返回值
- 影响100年的营销启示 24个故事
- 监听某个文件是否被修改
- (笔记)网络7层协议