Recyclerview not call any Adapter method :onCreateViewHolder,onBindViewHolder,

前端 未结 8 1823
灰色年华
灰色年华 2020-12-01 08:54

my RecyclerView do not call onCreateViewHolder, onBindViewHolder, therefore, does not appear nothing in recyclerview. I put logs for debugging, and no log is shown. What can

相关标签:
8条回答
  • 2020-12-01 09:36

    Other than @SanatiSharif's and @sohrab's answer, you have to follow below mandatory step.

    Make sure you call setLayoutManager, something like below.

    recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
    

    before setting adapter into recyclerView, otherwise it is not going to work. You can customize it if you need. this link will give you some idea of how LayoutManager works.

    0 讨论(0)
  • 2020-12-01 09:40

    As @yigit guess the combination of ScrollView, RelativeLayout causes this problem, Just make more room for RecyclerView.

    0 讨论(0)
提交回复
热议问题