match_parent width does not work in RecyclerView

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

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

           


        
10条回答
  •  忘掉有多难
    2020-11-27 13:40

    I solved this with:

     myInflatedRowLayout.getLayoutParams().width = vg.getWidth();
    

    It is replacing the MATCH_PARENT with the actual width of the RecyclerView.

提交回复
热议问题