问题:在父控件为RelativeLayout的布局中,如果先写了一个ListView,再写了一个Button,

写法1:

    xmlns:android="http://schemas.android.com/apk/res/android"    android:layout_width="match_parent"    android:layout_height="match_parent"    >            android:id="@+id/listview"        android:layout_width="match_parent"        android:layout_height="match_parent"        android:layout_above="@+id/button"        />            android:id="@+id/button"        android:layout_width="match_parent"        android:layout_height="50dp"        android:layout_alignParentBottom="true"/>
如上的写法按钮可见。



写法2:

    xmlns:android="http://schemas.android.com/apk/res/android"    android:layout_width="match_parent"    android:layout_height="match_parent"    >            android:id="@+id/listview"        android:layout_width="match_parent"        android:layout_height="match_parent"        />            android:id="@+id/button"        android:layout_width="match_parent"        android:layout_height="50dp"        android:layout_alignParentBottom="true"        android:layout_below="@+id/listview"/>
如上的写法按钮不可见。

更多相关文章

  1. Android(安卓)RecyclerView控件
  2. ScrollView中的控件占据ScrollView的match_parent
  3. Android快速开发框架dyh详解(五)---基础层的使用
  4. Android(安卓)Dialog 生命周期
  5. android findviewbyId 简化写法
  6. Android优雅的控制用户点击按钮的频率
  7. Android(安卓)漂亮的日期选择控件Time-Selector
  8. Android之基本组件
  9. android viewflipper 左右滑动切换显示图片效果

随机推荐

  1. Anaconda-用conda创建python虚拟环境
  2. 开源在企业中的前景预测
  3. Https实践
  4. 企业如何面对Tomcat的诸多安全漏洞?
  5. 一图说清Kubernetes资源控制机制:让我们重
  6. Python可以在手机上运行吗?QPython+主要功
  7. 云开发5分钟快速打造钉钉应用
  8. Secrets&安全上下文约束(SCC):让我们重新认
  9. OpenShift容量规划方法
  10. ING的容器云之路