含有過濾功能的android流式布局
FilterFlowLayout
含有過濾功能的流式布局, 參考FlowLayout
<me.codeboy.android.lib.FilterFlowLayout xmlns:cb="http://schemas.android.com/apk/res-auto" android:id="@+id/filterFlowLayout" android:layout_width="match_parent" android:layout_height="wrap_content" cb:maxWidthRatio="0.5" cb:minWidth="80dp" cb:maxLines="3" cb:horizontalGap="5dp" cb:verticalGap="5dp" >
maxWidthRatio 最大寬度比例,相對于FlowLayout的總寬度,默認-1 minWidthRatio 最小寬度比例,相對于FlowLayout的總寬度,默認-1 maxWidth 最大寬度,默認0 minWidth 最小寬度,默認0 maxLines 最大顯示行數,默認Integer.MAX_VALUE horizontalGap 每一行子試圖之間的空隙,默認是0 verticalGap 多行式行空隙,默認是0
相關方法
setMaxChildWidth(float maxChildWidth) //設置最大寬度 setMinChildWidth(float minChildWidth) //設置最小寬度 setMaxLines(int maxLines) //設置最大行數 setHorizontalGap(int horizontalGap) //設置水平間距 setVerticalGap(int verticalGap) //設置垂直間距
注意事項
- xml中同時設置寬度的比例與具體值時,比例(ratio)的優先級高于真實值。
- 寬度都不設置時,最大寬度為FlowLayout的寬度。 </ul>
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!