RecyclerView显示多种条目

    
Bean需要执行setItemType方法设置显示类型
naireQuestionListBean.setItemType(1);


Bean需要继承MultiItemEntity 
public static class NaireQuestionListBean extends MultiItemEntity {}

Adapter中需要继承BaseMultiItemQuickAdapter 
构造方法中执行addItemType方法
public class TwoQuesAdapter extends BaseMultiItemQuickAdapter {

    public TwoQuesAdapter(List data) {
        super(data);
        LogUtil.e("TwoQuesBean.NaireQuestionListBean.ITEM_ONE : ----------------" + TwoQuesBean.NaireQuestionListBean.ITEM_ONE);
        LogUtil.e("R.layout.item_two_new_quse_column : ----------------" + R.layout.item_two_new_quse_column);
        addItemType(TwoQuesBean.NaireQuestionListBean.ITEM_ONE,R.layout.item_two_new_quse_column);
//      addItemType(TwoQuesBean.NaireQuestionListBean.ITEM_TWO,R.layout.item_two_new_quse_column);
        addItemType(TwoQuesBean.NaireQuestionListBean.ITEM_THREE,R.layout.item_two_new_quse_column2);


    }

你可能感兴趣的:(RecyclerView显示多种条目)