Relativelayout
常见属性
android:layout_ toLeftOf
android:layout toRightOf
android:layout alignBottom
android:layout alignParentBottom
android:layout below
<?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="match_parent">
<View
android:id="@+id/view_1"
android:layout_width="100dp"
android:layout_height="100dp"
android:background="@color/purple_500" />
<View
android:id="@+id/view_2"
android:layout_width="100dp"
android:layout_height="100dp"
android:background="#00ff00"
android:layout_below="@+id/view_1"/>
<LinearLayout
android:id="@+id/ll_1"
android:background="@color/purple_500"
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_below="@+id/view_2"
android:orientation="horizontal"
android:padding="15dp">
<View
android:background="@color/teal_200"
android:layout_width="80dp"
android:layout_height="match_parent"/>
<RelativeLayout
android:background="@color/red"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="25dp">
<View
android:id="@+id/view_3"
android:background="@drawable/aaa"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_margin="20dp"/>
<View
android:id="@+id/view_4"
android:background="#00000f"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_toRightOf="@+id/view_3"/>
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
TextView
属性
- 文字大小、颜色
- 显示不下使用
- 文字+icon
- 中划线、下划线
- 跑马灯
新建一个activity
自己的事情自己做!!!!