布局属性很多,常用的有如下几种:
- android:id:控件的ID;
- android:layout_width:控件宽度设置,共三种:fill_parent/match_parent/wrap_content;
- android:layout_height:控件高度设置,三种设置同上;
- android:layout_weight:控件权重设置,如果在一个layout中有两个文本栏控件,如果想设置其中一个占用较多的空间,可以通过设置相应比例的权重来进行;
- android:orientation:布局下的控件排列方向;
- android:background:布局背景;
- android:text:控件文本显示;
- android:gravity:布局下的控件摆放方向,例如设置为center_horizontal,则控件会水平居中摆放;
- android:scrollbars:设置滚动条,共两种设置:vertical/horizontal;
- android:layout_margin:控件四个方向与边界的距离,单位为px;
- android:layout_marginTop:控件顶部与边界的距离;
- android:layout_marginBottom:控件底部与边界的距离;
- android:layout_marginLeft:控件左边与边界的距离;
- android:layout_marginRight:控件右边与边界的距离;
- android:textSize:文本字体大小;
- android:textColor:文本颜色;
- android:background:布局背景色;
其他还有很多设置,可以参见这个帖子: http://wenku.baidu.com/view/cef0c3e29b89680203d8256b.html