//按照垂直顺序排列
android:orientation="vertical"

android:id —— 为控件指定相应的ID

android:text ——指定控件当中显示的文字,需要注意的是,这里尽量使用strings.xml文件当中的字符串

android:grivity —— 指定控件里面的内容的基本位置,比如说居中,居右等位置

android:textSize —— 指定控件当中字体的大小

android:background —— 指定该控件所使用的背景色,RGB命名法

android:width —— 指定控件的宽度

android:height —— 指定控件的高度

android:padding* —— 指定控件的内边距,也就是说控件当中的内容

android:paddingLeft

android:paddingRight

android:paddingTop

android:paddingBottom

android:sigleLine —— 如果设置为真的话,则将控件的内容在同一行当中进行显示

dip单位跟屏幕的像素是没有关系的,适应能力比px更好

//表示该控件占的比例为 2/全部

android:layout_width="2"

//表示防止控件文字过多而换行

android:singleLine="true"

TableLayout的布局

//如果表格列数不能把屏幕填满,则拉伸第二列,从零开始计数

android:stretchColumns="1"

<TableLayout><TableRow><TextView/><TextView/></TableRow><TableRow><TextView/><TextView/></TableRow></TableLayout>

android:layout_above 将该控件的底部至于给定ID的控件之上

android:layout_above="@id/XXX"

android:layout_below 将该控件的顶部至于给定ID的控件之下

android:layout_toLeftOf 将该控件的右边缘和给定ID的控件的左边缘对齐

android:layout_toRightOf 将该控件的左边缘和给定ID的控件的右边缘对齐

android:layout_alignBaseline 该控件的baseline和给定ID的控件的baseline对齐

android:layout_alignBottom 将该控件的底部边缘与给定ID控件的底部边缘

android:layout_alignLeft 将该控件的左边缘与给定ID控件的左边缘对齐

android:layout_alignLeft="@id/XXX"

android:layout_alignRight 将该控件的右边缘与给定ID控件的右边缘对齐

android:layout_alignTop 将给定控件的顶部边缘与给定ID控件的顶部对齐

android:alignParentBottom 如果该值为true,则将该控件的底部和父控件的底部对齐

android:layout_alignParentLeft 如果该值为true,则将该控件的左边与父控件的左边对齐

android:layout_alignParentRight 如果该值为true,则将该控件的右边与父控件的右边对齐

android:layout_alignParentTop 如果该值为true,则将空间的顶部与父控件的顶部对齐

android:layout_centerHorizontal 如果值为真,该控件将被至于水平方向的中央

android:layout_centerInParent 如果值为真,该控件将被至于父控件水平方向和垂直方向的中央

android:layout_centerVertical 如果值为真,该控件将被至于垂直方向的中央


//这个是android自定义的一种颜色

android:background="@android:drawable/editbox_background"

更多相关文章

  1. RelativeLayout各个属性
  2. Android中RelativeLayout各个属性的含义
  3. android:layout_gravity 居中布局
  4. Android中的常用控件
  5. 相对布局
  6. 【Android(安卓)UI控件】EditText属性大全,TextView属性大全
  7. 系出名门Android(8) - 控件(View)之TextSwitcher, Gallery...
  8. Android(安卓)控件使用之SlidingDrawer
  9. Android中自定义Tab的实现

随机推荐

  1. Android内核3.10.73编译烧录到nexus 5X笔
  2. android ONVIF 组播探测在线摄像机
  3. Android(安卓)NFC架构分析
  4. Android(安卓)入门 和 环境搭建
  5. Android加载图片导致内存溢出(Out of Memo
  6. Android中更新UI的线程:Thread 、Handler
  7. 【Android】Android(安卓)UI 开发_问答_2
  8. vim+ctags+cscope 打造Android源码阅读工
  9. Android文档资源大放送 感兴趣的话可以网
  10. android开发资源汇总