答案 0 :(得分:1)
使用StaggeredGridLayoutManager! https://developer.android.com/reference/android/support/v7/widget/StaggeredGridLayoutManager
答案 1 :(得分:0)
尝试为Recyclerview设置像这样的布局管理器。
Enter the total items: 3
Enter the shopping item: shopping_item_1
Enter the price of item: 1
Enter the shopping item: shopping_item_2
Enter the price of item: 2
Enter the shopping item: shopping_item_3
Enter the price of item: 3
The Total of shopping_item_1, shopping_item_2, shopping_item_3 is 6 and the average price of the items are 1.0
SpacesItemDecorationNew
adapter = new CustomAdapter(R.layout.layout, list, context);
final StaggeredGridLayoutManager layoutManager = new StaggeredGridLayoutManager(numberOfrows, StaggeredGridLayoutManager.HORIZONTAL);
recyclerView_sk.setHasFixedSize(true);
recyclerView_sk.addItemDecoration(new SpacesItemDecorationNew(0));//For equal distribution of columns.
recyclerView_sk.setLayoutManager(layoutManager);
recyclerView_sk.setAdapter(adapter);
答案 2 :(得分:0)
此外,您可以尝试
> f :: (Bar a1 b, Foo a2 a1) => a2 -> b
> f x = bar (foo x)