布局:  
   <LinearLayout></LinearLayout>
   <RelativeLayout></RelativeLayout>
   <FrameLayout></FrameLayout>
   <TableLayout></TableLayout>
四种布局的公共属性:            android:id="@+id/id_name"                        android:layout_width="wrap_content"                                ="match_parent"                                                     android:layout_height="wrap_content"                                 ="match_parent"                                                      android:text="message"                            ||显示文字                        android:src="@drawable/ic_launcher"              ||显示图片                        android:hint="tips"                                ||提示文字                        android:inputType="textPassword"                ||按照密文的方式输入,隐藏输入内容
       
       ...
<LinearLayout></LinearLayout> 属性: android:orientation="vertical"   ||垂直 ="horizontal" ||水平 android:layout_gravity="top" ="bottom" ="center" ="center_vertical" ="center_horizontal" ... android:layout_weight="1" ||权重 <RelativeLayout></RelativeLayout> 属性: android:layout_alignParentLeft="true" ||对齐于父类的左侧 ="false" android:layout_alignParentRight="true" ||对齐于父类的右侧 ="false" android:layout_alignParentTop="true" ||对齐于父类的上侧 ="false" android:layout_alignParentBottom="true" ||对齐于父类的底侧 ="false" android:layout_centerInParent="true" ||对齐于父类的中心 ="false" android:layout_above="@id/id_name" ||在某一控件的上方(注意要先定义被引用的控件) android:layout_below="@id/id_name" ||在某一控件的下方 android:layout_toLeftOf="@id/id_name" ||在某一控件的左方 android:layout_toRightOf="@id/id_name" ||在某一控件的右方 android:layout_alignLeft="@id/id_name" ||本控件的左边缘和某一控件的左边缘对齐 android:layout_alignRight="@id/id_name ||本控件的右边缘和某一控件的右边缘对齐 android:layout_alignTop="@id/id_name" ||本控件的上边缘和某一控件的上边缘对齐 android:layout_alignBottom="@id/id_name" ||本控件的下边缘和某一控件的下边缘对齐 <FrameLayout></FrameLayout> 属性: 全部控件均摆放在布局的左上角(碎片) <TableLayout></TableLayout> 属性: <TableRow></TableRow> 在表格中添加一行,TableRow中添加一个控件则增加一列 属性: android:layout_span="2" ||占据2列的空间 android:stretchColumns="1" ||拉伸第2列使的行充满父类 android:stretchColumns="0" ||拉伸第1列使的行充满父类

更多相关文章

  1. RelativeLayout布局中控件常用布局属性
  2. android:layout_gravity和android:gravity的区别
  3. android text右对齐显示 并且 多余文字显示省略号
  4. android - XML布局大全
  5. Android中的ImageButton标签属性
  6. Android中的ImageButton标签属性
  7. android 布局属性
  8. android中的布局文件
  9. android:layout_marginLeft android:paddingLeft android:layout

随机推荐

  1. 《Android开发从零开始》――10. LinearL
  2. Android 学习笔记--android――listview
  3. Deepin Android Studio 修改默认源 提高
  4. Android UI之ImageView旋转的几种方式
  5. Android中SensorManager.getRotationMatr
  6. 关于android中的各种路径对应的方法
  7. Android 自定义 Adapter
  8. SwipeRefreshLayout + RecyclerView 实现
  9. Android实现睡眠设置
  10. Android 内存分析命令