android:layout_above="@+id/XXX"与android:layout_below="@+id/XXX"写法的区别
16lz
2021-01-25
问题:在父控件为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" />
如上的写法按钮可见。 写法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(安卓)RecyclerView控件
- ScrollView中的控件占据ScrollView的match_parent
- Android快速开发框架dyh详解(五)---基础层的使用
- Android(安卓)Dialog 生命周期
- android findviewbyId 简化写法
- Android优雅的控制用户点击按钮的频率
- Android(安卓)漂亮的日期选择控件Time-Selector
- Android之基本组件
- android viewflipper 左右滑动切换显示图片效果