match_parent width does not work in RecyclerView

后端 未结 10 1386
深忆病人
深忆病人 2020-11-27 13:25

My RecyclerView and item has match_parent width but the result is : \"enter

           


        
10条回答
  •  北海茫月
    2020-11-27 13:39

    Can't see your full code, but can guess, that some of the views inside your LinearLayout are 'wrap_content'. You need to make one or some of them expand to the full width by using 'android:layout_weight="1"'

    update: you have a lot of redundant layout_weight's. Make them all 'wrap_content' and for only one of them add layout_weight=1 - for the last CustomTextView. This way, it will occupy all the blank space.

提交回复
热议问题