任何想法如何LayoutManager在一个视图中使用两个不同的?我在屏幕和底部的顶格四张牌,我想LinearLayout,但RecyclerView一次显示一个视图
RecyclerView.LayoutManager mLayoutManager = new GridLayoutManager(this, 2);
recyclerView.setLayoutManager(mLayoutManager);
RecyclerView.LayoutManager lmLayoutManager = new LinearLayoutManager(this);
recyclerView.setLayoutManager(lmLayoutManager);
recyclerView.addItemDecoration(new GridSpacingDashboard(2, dpToPx(2), true));
recyclerView.setItemAnimator(new DefaultItemAnimator());
recyclerView.setAdapter(adapter);
Run Code Online (Sandbox Code Playgroud)
有没有什么方法可以在单个RecyclerView或者在索引OI上使用两个视图,GridLayout并且在1上显示LinearLayout,如果有任何可能性,如何实现
更新(卡适配器)
public class CardAdapter extends RecyclerView.Adapter<adapter.CardAdapter.CardViewHolder> {
public static final int topGridCard = 0;
public static final int bottomCards=1;
private Context mContext;
private List<CardModel> cardList;
public CardAdapter(Context mContext, List<CardModel> cardList) {
this.mContext = mContext;
this.cardList = cardList;
}
@Override
public.adapter.CardAdapter.CardViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View …Run Code Online (Sandbox Code Playgroud) android android-layout recycler-adapter android-recyclerview