android 仿qq it蓝豹,《IT蓝豹》listview实现各种版面设计功能
本項(xiàng)目主要listview實(shí)現(xiàn)各種版面設(shè)計(jì)功能,有實(shí)現(xiàn)列表的,gridview效果的,有混排效果的等等。
自定義TwoWayView繼承RecyclerView,通過(guò)TwoWayView去根據(jù)布局實(shí)現(xiàn)到底選擇哪一個(gè)效果,
本項(xiàng)目來(lái)自: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"/>
實(shí)現(xiàn)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" />
實(shí)現(xiàn)混排效果:
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" />
運(yùn)行效果:
總結(jié)
以上是生活随笔為你收集整理的android 仿qq it蓝豹,《IT蓝豹》listview实现各种版面设计功能的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: android webview 重定向
- 下一篇: android网络重试机制,okhttp