android:layout_alignleft layout_toleftof 使用,详解RelativeLayout布局属性 ,搜索xm布局
来源:互联网 发布:软件流程图模板 编辑:程序博客网 时间:2024/06/05 11:00
首先把常用的布局分组。(会对所有的对其方式解释,且主要讨论layout_alignleft layout_toleftof区别) android:layout_above 将该控件的底部至于给定ID的控件之上(只写一行代该控件底部与id控件上边缘对其,且默认于父布局左边) android:layout_below 将该控件的顶部至于给定ID的控件之下(只写一行代该控件顶部与id控件下边缘对其,且默认于父布局左边) android:layout_toLeftOf 将该控件的右边缘和给定ID的控件的左边缘对齐,默认是位于父布局的顶部 android:layout_toRightOf 将该控件的左边缘和给定ID的控件的右边缘对齐,默认位于父布局的顶部(默认父布局的左和上) android:layout_alignBaseline 该控件的baseline和给定ID的控件的baseline对齐android:layout_alignBottom 将该控件的底部边缘与给定ID控件的底部边缘对其(该控件还是默认位于父布局的左边) android:layout_alignTop 将给定控件的顶部边缘与给定ID控件的顶部对齐(该控件还是默认位于父布局的左边)效果和上边一样 android:layout_alignLeft 将该控件的左边缘与给定ID控件的左边缘对齐(该控件默认位于父布局的上边)android:layout_alignRight 将该控件的右边缘与给定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 如果值为真,该控件将被至于垂直方向的中央(默认父布局的左边)
================================================================
搜索界的框框:
<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/gray_alph"> <RelativeLayout android:id="@+id/af_search_rl" android:layout_width="match_parent" android:layout_height="50dp" android:layout_alignParentTop="true" android:background="#20b2aa" android:paddingRight="10dp" > <ImageView android:id="@+id/af_head_search_back" android:layout_width="40dp" android:layout_height="wrap_content" android:layout_centerVertical="true" android:layout_alignParentLeft="true" android:paddingLeft="8dp" android:paddingRight="8dp" android:src="@drawable/selector_arrow_left" /> <ImageView android:id="@+id/af_head_search_x" android:layout_width="40dp" android:layout_height="wrap_content" android:layout_centerVertical="true" android:layout_alignParentRight="true" android:paddingLeft="8dp" android:paddingRight="8dp" android:src="@drawable/selector_clear_x" /> <EditText android:id="@+id/af_head_search_et" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_toLeftOf="@+id/af_head_search_x" android:layout_toRightOf="@+id/af_head_search_back" android:layout_centerVertical="true" android:gravity="bottom" android:hint="@string/search" android:text="@string/search" android:background="#00000000" android:textColor="@color/white" android:textColorHint="@color/white" android:singleLine="true" android:textSize="18sp" /> <TextView android:layout_below="@+id/af_head_search_et" android:layout_marginTop="3dp" android:layout_toRightOf="@+id/af_head_search_back" android:layout_width="match_parent" android:background="@color/white" android:layout_height="1dp" /> </RelativeLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_below="@+id/af_search_rl" > <ListView android:id="@+id/af_lv_msg_list" android:layout_width="fill_parent" android:layout_height="fill_parent" android:cacheColorHint="@android:color/transparent" android:divider="@null" android:visibility="visible" android:scrollbars="none" /> </LinearLayout></RelativeLayout>
布局显示结果:
0 0
- android:layout_alignleft layout_toleftof 使用,详解RelativeLayout布局属性 ,搜索xm布局
- android:layout_alignleft layout_toleftof区别,详解RelativeLayout布局属性
- android:layout_alignleft layout_toleftof区别,详解RelativeLayout布局属性
- android:layout_alignleft layout_toleftof区别详解
- android布局属性详解 RelativeLayout
- Android RelativeLayout布局属性详解
- Android布局-RelativeLayout属性详解
- 在代码中设置RelativeLayout布局中标签的android:layout_toLeftOf、android:layout_toRightOf等属性
- android布局属性详解(RelativeLayout属性)
- RelativeLayout布局属性详解
- 相对布局的layout_alignLeft属性
- 相对布局的layout_alignLeft属性
- android RelativeLayout布局属性
- Android RelativeLayout布局属性
- Android Relativelayout布局属性
- android相对布局(RelativeLayout)属性详解
- Android RelativeLayout布局之常用属性详解
- Android布局属性详解之RelativeLayout
- opencv python 图像二值化
- HDU 1536 S-Nim (SG函数)
- mysql 安装 和解决navicat 10061 1045错误
- MySQL 5.6 的MASTER – SLAVE 主从实例配置及切换 (一)
- JavaScript事件
- android:layout_alignleft layout_toleftof 使用,详解RelativeLayout布局属性 ,搜索xm布局
- MFC在状态栏中使用进度条控件
- C++map实现
- Jar包进程Kill前处理完未完成的业务代码
- L2-013. 红色警报
- 蓝桥——未名湖边的烦恼(DP)
- Linux入门
- 阻塞式I/0 和 非阻塞式I/O 同步异步详细介绍
- 接口优化了的观察者模式