第六节--LinearLayout布局的介绍和应用
来源:互联网 发布:电路仿真软件中文版 编辑:程序博客网 时间:2024/04/30 01:05
View:
LinearLayout:
java.lang.Object ↳android.view.View ↳android.view.ViewGroup ↳android.widget.LinearLayout原意:
A Layout that arranges its children in a single column or a single row. The direction of the row can be set by calling setOrientation(). You can also specify gravity, which specifies the alignment of all the child elements by calling setGravity() or specify that specific children grow to fill up any remaining space in the layout by setting the weight member of LinearLayout.LayoutParams. The default orientation is horizontal.
译文:
一个布局是对在行或列方向的子控件的安排。行的方向我们可以通过调用setOrientation()方法来设置。也可以通过指定它的gravitgy,通过调用setGravity()方法或指定子控件的空间填充来指定子控件元素的排列方向。缺省状态为水平方向。
XML属性:
android:id : 为控件指定相应的ID
android:text: 指定控件当中显示的文字
android:grivity: 指定控件的基本位置,比如说居中,居右等位置
android:textSize:指定控件当中字体的大小
android:background: 使用drawable指定该控件所使用的背景色,RGB命名法
android:width: 指定控件的宽度
android:height: 指定控件的高度
android:padding* : 指定控件的内边距,也就是说控件当中的内容
android:sigleLine: 如果设置为真的话,则将控件的内容在同一行当中进行显示
layout_weight: 用于给一个线性布局中的诸多视图的重要度赋值
android:layout_gravity: 表示按钮在界面上的位置
android:gravity : 表示button上的字在button上的位置
android:visibility: 控制视图控件的可见性
ndroid:baselineAligned:是否允许用户调整它内容的基线
a.lang.Object ↳android.view.View
原意:
This class represents the basic building block for user interface components. A View occupies a rectangular area on the screen and is responsible for drawing and event handling. View is the base class for widgets, which are used to create interactive UI components (buttons, text fields, etc.). The ViewGroup subclass is the base class for layouts, which are invisible containers that hold other Views (or other ViewGroups) and define their layout properties.
译文:
这个类代表了用户界面组件的基本构造块。一个View在屏幕上占据一个矩形区域,并绘制和事件处理工作。View是控件的基本类,它是用来创建交互式UI组件(按钮,文本框等)的。该ViewGroup的是基类布局的子类,它是一种无形的容器,可以保留其它控件视图和布局属性。
ViewGroup:
java.lang.Object ↳android.view.View ↳android.view.ViewGroup原意:
A ViewGroup
is a special view that can contain other views (called children.) The view group is the base class for layouts and views containers.
译文:
一个ViewGroupis一个能包含其它View的视图,它是一个能包含布局容器的基类布局
演示效果:
- 第六节--LinearLayout布局的介绍和应用
- 第七节--RelativeLayout布局的介绍和应用
- android布局LinearLayout的隐藏和显示
- android的常用布局LinearLayout和RelativeLayout
- LinearLayout和RelativeLayout布局
- LinearLayout和RelativeLayout布局
- 线性布局LinearLayout和相对布局RelativeLayout 之间的比较
- Android应用的LinearLayout中嵌套RelativeLayout的布局用法
- Android的LinearLayout布局
- LinearLayout布局的Layout_weight
- LinearLayout布局的Layout_weight
- LinearLayout布局的解析
- HTML5第六课时,布局的简单应用
- android布局 LinearLayout和RelativeLayout
- android 常用布局LinearLayout以及RelativeLayout介绍
- LinearLayout布局~一些属性如orientation介绍
- Android学习 - LinearLayout布局和RelativeLayout布局
- android布局LinearLayout的使用
- 关于fopen的几种模式
- s:select 标签
- Feedback Nerual Network(三):Design symetric link weight matrix
- 网页代码常用小技巧!
- 开始研发OV7725sensor
- 第六节--LinearLayout布局的介绍和应用
- C# XML
- 二叉树遍历递归实现
- 台阶问题
- Build Security In
- Tfs 2010使用小技巧
- oracle lpad 函数
- magento -- 在magento中如何回复客户的评论
- 吃一堑长一智系列