Android RelativeLayout 相对布局
作者:互联网
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
android:orientation="vertical">
<TextView
android:id="@+id/one"
android:layout_centerInParent="true"
android:layout_width="120dp"
android:layout_height="120dp"
android:background="#4593Ec"
android:gravity="center"
android:text="1"
android:textColor="@color/white"
android:textSize="40sp"/>
<TextView
android:id="@+id/two"
android:layout_alignParentBottom="true"
android:layout_width="120dp"
android:layout_height="120dp"
android:background="#7DB145"
android:gravity="center"
android:text="2"
android:textColor="@color/white"
android:textSize="25sp"/>
<TextView
android:id="@+id/three"
android:layout_alignParentRight="true"
android:layout_width="120dp"
android:layout_height="120dp"
android:background="#F10000"
android:gravity="center"
android:text="3"
android:textColor="@color/white"
android:textSize="25sp"/>
</RelativeLayout>
标签:相对,Android,布局,RelativeLayout 来源: https://blog.csdn.net/SeNiLS/article/details/114738254