ListView添加HeaderView后,HeaderView里的控件设置某些属性不起作用
2016-05-12 16:34
337 查看
当我们为listview,add一个headerView时,headerview里有好多控件,例如:
<RelativeLayout
android:id="@+id/rl_apply_content"
android:layout_width="match_parent"
android:layout_height="350dp"
android:background="@drawable/live_apply">
<ImageView
android:id="@+id/shader"
android:layout_width="match_parent"
android:layout_height="150dp"
android:layout_alignParentBottom="true"
android:background="@drawable/video_bottom_height448" />
<ImageView
android:id="@+id/iv_apply"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignTop="@+id/shader"
android:layout_centerHorizontal="true"
android:src="@drawable/apply" />
</RelativeLayout>第二个ImageView如果设置marginBottom,会不起作用,此时我们要把布局改成下面这样:
<?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="wrap_content">
<RelativeLayout
android:id="@+id/rl_apply_content"
android:layout_width="match_parent"
android:layout_height="350dp"
android:background="@drawable/live_apply">
<ImageView
android:id="@+id/shader"
android:layout_width="match_parent"
android:layout_height="150dp"
android:layout_alignParentBottom="true"
android:background="@drawable/video_bottom_height448" />
<ImageView
android:id="@+id/iv_apply"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignTop="@+id/shader"
android:layout_centerHorizontal="true"
android:src="@drawable/apply" />
</RelativeLayout>
</RelativeLayout>搞定
相关文章推荐
- String——表示数值的字符串
- php CURL 发送请求详解
- 20160512
- Add Tags to Neutron Resources
- 卷积神经网络(二)
- 从IRQ到IRQL(PIC版)
- 树莓派摄像头模块没有/dev/video0设备节点的问题
- Oracle VM + centos7.1+openstack kilo 多结点安装教程---neutron的安装(3)
- MJRefresh 原理实现
- Unity3D开发之游戏兑换码的分析设计以及生成
- HDU 2311-Nim or not Nim?(Nim博弈-打sg表找规律)
- Android Bitmap 基础学习
- JQ一些常用的方法
- Mac_您不能拷贝项目“”,因为它的名称太长或包括的字符在目的宗卷上无效
- Docker的优势
- 关于object-c的基本知识
- 20160512 GreenPlum13 查询自己建的表名
- mac画图工具 OmniGraffle (四)化繁为简
- 初次使用dwr出现的问题
- Postgres