cloudzhou

 

android学习笔记(二)

LinearLayout:线性布局.可以使用垂直线形布局,也可以使用水平布局,在LinearLayout里面可以放多个控件,但是一行(列)只能放一个控件.
android:orientation = "vertical"  垂直方式排列
android:orientation = "horizontal" 水平方式排列

RelativeLayout:相对布局.RelativeLayout里面可以放多个控件,不过控件的位置都是相对位置.
android:layout_below = "@id/label"  运用上一个标签id缩定上一个标签的相对位置,将自身标签排列在其下.
android:layout_toLeftOf = "@id/label" 将自身标签缩定在上一个标签之左.
android:layout_alignTop = "@id/label" 将自身标签缩定和上一个标签相同高度.

TableLayout:表单布局.这要和TableRow配合使用,很像HTML里面的TABLE.
<TableLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:stretchColumns="1">
<TableRow>
    <TextView
        android:layout_column="1"
        android:text="打开..."
        android:padding="3dip"/>
    <TextView
        android:text="Ctrl-O"
        android:gravity="right"
        android:padding="3dip"/>
</TableRow>
</TableLayout>

posted on 2011-02-23 14:22 周晓磊 阅读(66) 评论(0)  编辑  收藏


只有注册用户登录后才能发表评论。


网站导航:
 

导航

统计

留言簿

文章档案

搜索

最新评论