RelativeLayout 知识点
来源:互联网 发布:英语口语8000句软件 编辑:程序博客网 时间:2024/06/09 17:31
1.RelativeLayout层叠
a.布局文件如下
<RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBottom="@+id/vp_content" android:layout_alignParentRight="true" ><!-- 这里放了一个LinearLayout 和一个ImageView,他的先后顺序,决定了层次的上下,若是这样布局,则LinearLayout在上层。 --> <LinearLayout android:id="@+id/ll_point_list" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal" > </LinearLayout> <ImageView android:id="@+id/red_point" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/small_point_red" /> </RelativeLayout>
b.结论
所以在RelativeLayout布局中加控件时要考虑先后顺序,放在前面的在下层。
摘:http://www.th7.cn/Program/Android/201404/188860.shtml
1.RelativeLayout布局中的元素如果要实现元素叠加必须设置RelativeLayout.ALIGN_PARENT_TOP 和 RelativeLayout.ALIGN_PARENT_LEFT 这样元素才会进行叠加,否则元素就会按照加入的顺序无叠加放置。
2.RelativeLayout布局中的叠加元素的次序只决定于声明的先后(无论是使用xml布局文件还是使用纯代码布局),也就是说一旦开始决定了他们的叠放次序,就无法更改了,即使删除之后再次进行添加也不行。
0 0
- RelativeLayout 知识点
- ‘RelativeLayout’
- RelativeLayout
- RelativeLayout
- RelativeLayout
- RelativeLayout
- RelativeLayout
- RelativeLayout
- RelativeLayout
- RelativeLayout
- RelativeLayout
- RelativeLayout
- RelativeLayout
- RelativeLayout
- Relativelayout
- RelativeLayout
- RelativeLayout
- RelativeLayout
- 初来大学
- leetcode 56:Merge Intervals
- [LeetCode]Longest Substring Without Repeating Characters
- JS获取浏览器窗口大小 获取屏幕,浏览器,网页高度宽度
- oracle数据库的问题和大数据的前景问题
- RelativeLayout 知识点
- nyoj--747--蚂蚁的难题(三)(dp背包)
- 验证码识别
- JAVA后台报-数据库里面的某张表序列无效的错误
- Linux下mysql安装和一些基础操作
- 轻松学习JavaScript四:JS点击灯泡来点亮或熄灭这盏灯的网页特效映射出JS在HTML中作用
- VS编程中_T与L的区别
- 常用的mysql命令
- 第十周项目6 二叉树b中值为x的层数