Geekband第二周1.1

来源:互联网 发布:qq飞车s车数据 编辑:程序博客网 时间:2024/05/17 07:37

1、linerlayout

android:orientation="horizontal";//排列方向水平竖直
android:weightSum="10"然后再具体控件里面用layout_weight按比重分配
用来实现正好控件一人一半不用具体计算占屏大小
注释和反注释快捷键"ctrl+/"

2、RelativeLayout

//资源文件,文件名不能大写

xmlns:android="http://schemas.android.com/apk/res/android"    命名控件,为了后面能够使用android:这样的属性
相对布局,相对于具体某一个,相对于角,相对于空间(中间)
代码有Z轴概念,后面写的会覆盖在之前的上面
通过id找到具体摸个控件
android:layout_above="@+id/button"//layout_belowandroid:layout_alignParentRight="true"
类推、、、
align----参照,基于,与对应控件的上下左右平行//
android:layout_alignTop="@+id/button"
外边距margin上下左右边距!
内边距padding
3、FrameLayout帧布局
layout按层来
一层一层向上叠
4、TableLayout
<TableLayout    android:layout_width="wrap_content"    android:layout_height="wrap_content">    <TableRow>            </TableRow></TableLayout>

0 0
原创粉丝点击