<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
app:layout_constraintDimensionRatio="W,15:20"
android:id="@+id/iv"
android:background="#FF0000"
android:src="@drawable/ic_action_share"
android:layout_width="100dp"
android:layout_height="0dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
<TextView
android:background="#FF00FF"
android:id="@+id/title"
android:textSize="20dp"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintLeft_toRightOf="@id/iv"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@id/iv"/>
<TextView
android:background="#FFFF00"
android:id="@+id/content"
android:layout_width="0dp"
android:layout_height="0dp"
android:text="Hello World!"
app:layout_constraintTop_toBottomOf="@id/title"
app:layout_constraintLeft_toRightOf="@id/iv"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintBottom_toBottomOf="@id/iv"/>
</android.support.constraint.ConstraintLayout>
<android.support.constraint.ConstraintLayout
android:layout_marginBottom="10dp"
app:layout_constraintBottom_toTopOf="@id/tab_host"
android:layout_width="match_parent"
android:background="#EEFF00"
android:layout_height="80dp">
<TextView
app:layout_constraintHorizontal_chainStyle="packed"
android:background="#FF00FF"
android:id="@+id/n_tab1"
android:textSize="20dp"
android:text="我的"
android:gravity="center"
android:layout_width="120dp"
android:layout_height="wrap_content"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/n_tab2"
/>
<TextView
app:layout_constraintHorizontal_chainStyle="packed"
android:background="#8800FF"
android:id="@+id/n_tab2"
android:textSize="20dp"
android:text="发现"
android:gravity="center"
android:layout_width="120dp"
android:layout_height="wrap_content"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/n_tab1"
app:layout_constraintRight_toLeftOf="@id/n_tab3"
/>
<TextView
app:layout_constraintHorizontal_chainStyle="packed"
android:background="#00FF00"
android:id="@+id/n_tab3"
android:textSize="20dp"
android:text="个人中心"
android:gravity="center"
android:layout_width="120dp"
android:layout_height="wrap_content"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintLeft_toRightOf="@id/n_tab2"
/>
</android.support.constraint.ConstraintLayout>
<android.support.constraint.ConstraintLayout
app:layout_constraintBottom_toBottomOf="parent"
android:layout_width="match_parent"
android:background="#EEFFEE"
android:id="@+id/tab_host"
android:layout_height="80dp">
<TextView
android:background="#FF00FF"
android:id="@+id/tab1"
android:textSize="20dp"
android:text="我的"
android:gravity="center"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintVertical_weight="1"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/tab2"
/>
<TextView
android:background="#8800FF"
android:id="@+id/tab2"
android:textSize="20dp"
android:text="发现"
android:gravity="center"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintVertical_weight="1"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/tab1"
app:layout_constraintRight_toLeftOf="@id/tab3"
/>
<TextView
android:background="#00FF00"
android:id="@+id/tab3"
android:textSize="20dp"
android:text="个人中心"
android:gravity="center"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintVertical_weight="1"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintLeft_toRightOf="@id/tab2"
/>
</android.support.constraint.ConstraintLayout>
<TextView
android:background="#00FF00"
android:id="@+id/float_view"
android:textSize="20dp"
android:text="浮动按钮"
android:gravity="center"
android:layout_width="60dp"
android:layout_height="60dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintVertical_bias="0.3"
app:layout_constraintHorizontal_bias="0.05"
/>
</android.support.constraint.ConstraintLayout>