android 仿qq it蓝豹,《IT蓝豹》listview实现各种版面设计功能
本項目主要listview實現各種版面設計功能,有實現列表的,gridview效果的,有混排效果的等等。
自定義TwoWayView繼承RecyclerView,通過TwoWayView去根據布局實現到底選擇哪一個效果,
本項目來自:https://github.com/lucasr/twoway-view
listview代碼部分:
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
style="@style/TwoWayView"
app:twowayview_layoutManager="ListLayoutManager"/>
實現gradview效果:
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
style="@style/TwoWayView"
app:twowayview_layoutManager="GridLayoutManager"
app:twowayview_numColumns="3"
app:twowayview_numRows="3" />
實現混排效果:
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
style="@style/TwoWayView"
app:twowayview_layoutManager="StaggeredGridLayoutManager"
app:twowayview_numColumns="2"
app:twowayview_numRows="2" />
運行效果:
總結
以上是生活随笔為你收集整理的android 仿qq it蓝豹,《IT蓝豹》listview实现各种版面设计功能的全部內容,希望文章能夠幫你解決所遇到的問題。
 
                            
                        - 上一篇: android webview 重定向
- 下一篇: android网络重试机制,okhttp
