码迷,mamicode.com
首页 > 移动开发 > 详细

ANDROID UI布局学习

时间:2016-01-25 19:10:51      阅读:198      评论:0      收藏:0      [点我收藏+]

标签:

一、LINEARLAYOUT 线性布局
android:layout_width=""match_parent 适应父控件 fill_parent 填充父控件 wrap_content 内容包裹
android:orientation="" 方向选择 vertical 竖向 horizontal 横向
android:laytou_weight="" 权重

二、FRAMELAYOU 框架布局

三、RELATIVELAYOUT 相对布局
android:layout_toRightOf="@id/button" 位于BUTTON右边
android:layout_toLeftOf="@id/button" 位于BUTTON左边
android:layout_below="@id/button" 位于BUTTON下边
android:layout_above="@id/button" 位于BUTTON上边
四 TABLELAYOUT 表格布局

    <TableLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:stretchColumns="0,1,2,3" >

        <TableRow
            android:layout_width="match_parent"
            android:layout_height="wrap_content" >

            <Button
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="button1" />

            <Button
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="button1" />

            <Button
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="button1" />

            <Button
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="button1" />
        </TableRow>
    </TableLayout>

 

ANDROID UI布局学习

标签:

原文地址:http://www.cnblogs.com/czjiangxu/p/5157838.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!