-7
我想創建一個使用Recycerview.but我正在流汗一些問題,它這種類型的佈局。
recyclerView.setLayoutManager(new GridLayoutManager(parentActivity, 2));
使用上述線,我有顯示列表中2列。但當一些視圖的高度小,則得到空白space..i要移除該空白空間。
問題截圖:
請給予解決方案,以去除空間。
我想創建一個使用Recycerview.but我正在流汗一些問題,它這種類型的佈局。
recyclerView.setLayoutManager(new GridLayoutManager(parentActivity, 2));
使用上述線,我有顯示列表中2列。但當一些視圖的高度小,則得到空白space..i要移除該空白空間。
問題截圖:
請給予解決方案,以去除空間。
您可以使用StaggeredGridLayoutManager
sGManager = new StaggeredGridLayoutManager(2, 1);
recyclerView.setLayoutManager(gaggeredGridLayoutManager)
看到http://inducesmile.com/android/android-staggeredgridlayoutmanager-example-tutorial/
thnks.its工作正常。 – dipali
試試這個https://github.com/etsy/AndroidStaggeredGrid – Rohit5k2
@ Rohit5k2 thnks但即時通訊使用recyclerview.and我想基於它的變化在gridlayout管理器 – dipali
這將做的工作,然後http://developer.android.com/reference/android/support/v7/widget/StaggeredGridLayoutManager.html – Rohit5k2