百分比佈局支持的屬性

layout_widthPercent = 寬的百分比 、 

layout_heightPercent =  高的百分比

layout_marginPercent = 距離所有邊緣邊緣百分比 、 

layout_marginLeftPercent =  距離左邊的百分比、

layout_marginTopPercent = 距離上邊的百分比、 

layout_marginRightPercent = 距離右邊的百分比

layout_marginBottomPercent = 距離下邊的百分比、 

下面兩個屬性爲距離開始和結束的距離不理解

開始和結束不是left和right嗎?

layout_marginStartPercent =  距離開始的地方百分比、

layout_marginEndPercent = 距離結束的地方百分比

導入

//    compile 'com.android.support:percent:24.1.1'




compile 'com.mxn.soul:flowingdrawer-core:1.1.0'
<ScrollView
    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">
    <com.zhy.android.percent.support.PercentLinearLayout
        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="wrap_content"
        android:orientation="vertical">

        <TextView
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:gravity="center"
            android:textColor="#ff44aacc"
            android:text="未己公司作品"
            android:textSize="25dp"
            app:layout_heightPercent="25%w"/>
        <TextView
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:background="#ff44aacc"
            android:gravity="center"
            android:text="最終解釋權爲未己公司所有"
            android:textColor="#ffffff"
            app:layout_heightPercent="30%w"
            />


    </com.zhy.android.percent.support.PercentLinearLayout>
</ScrollView>

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章