android之【RelativeLayout布局】
16lz
2021-01-23
<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"android:orientation="vertical"android:layout_width="fill_parent"android:layout_height="fill_parent"><!-- 定义该组件位于父容器中间 --><TextView android:id="@+id/view01"android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/leaf"android:layout_centerInParent="true"/><!-- 定义该组件位于view01组件的上方 --><TextView android:id="@+id/view02"android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/leaf"android:layout_above="@id/view01"android:layout_alignLeft="@id/view01"/><!-- 定义该组件位于view01组件的下方 --><TextView android:id="@+id/view03"android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/leaf"android:layout_below="@id/view01"android:layout_alignLeft="@id/view01"/><!-- 定义该组件位于view01组件的左边 --><TextView android:id="@+id/view04"android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/leaf"android:layout_toLeftOf="@id/view01"android:layout_alignTop="@id/view01"/><!-- 定义该组件位于view01组件的右边 --><TextView android:id="@+id/view05"android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/leaf"android:layout_toRightOf="@id/view01"android:layout_alignTop="@id/view01"/></RelativeLayout>
更多相关文章
- Android自定义视图二:用Canvas和Paint绘制折线图
- android 自定义组件圆形边框
- android中自定义attr,以及style杂谈
- Android 的自定义Spinner组件实现方式
- 实习杂记(20)---Android里面shape定义图形相关属性
- Android中为窗口定义主题
- Android Studio 之 View组件常用属性及其对应的编程接口
- Android 解决自定义 CheckBox 样式时的背景显示异常问题
- Android彻底组件化—代码和资源隔离