Android关于百分比布局-android.support.percent.PercentFram

<?xml version="1.0" encoding="utf-8"?>
<android.support.percent.PercentFrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

   


    <TextView
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_gravity="bottom"
        android:background="#770000ff"
        android:text="Textview"
        android:gravity="center"
        app:layout_heightPercent="10%"
        app:layout_widthPercent="100%"/>




</android.support.percent.PercentFrameLayout>

控件的百分比主要是:app:layout_heightPercent和app:layout_widthPercent这两个属性。。一个是宽的百分比,一个是高的百分比。。。很好的适配屏幕。。。。