How do I make WRAP_CONTENT work on a RecyclerView

后端 未结 19 1690
自闭症患者
自闭症患者 2020-11-22 12:49

I have a DialogFragment that contains a RecyclerView (a list of cards).

Within this RecyclerView are one or more CardVi

相关标签:
19条回答
  • Update your view with null value instead of parent viewgroup in Adapter viewholder onCreateViewHolder method.

    @Override
    public AdapterItemSku.MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    
        View view = inflator.inflate(R.layout.layout_item, null, false);
        return new MyViewHolder(view);
    }
    
    0 讨论(0)
提交回复
热议问题