依赖:
compile 'com.android.support:percent:22.2.0'
<android.support.percent.PercentRelativeLayout
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<View
android:id="@+id/a1"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="#00ff00"
app:layout_heightPercent="20%"
app:layout_widthPercent="70%"/>
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_toRightOf="@+id/a1"
android:background="#ffff00"
app:layout_heightPercent="40%"
app:layout_widthPercent="20%"/>
</android.support.percent.PercentRelativeLayout>