Find the view on the last position of RecyclerView?

后端 未结 3 854
广开言路
广开言路 2021-01-29 15:18

The below code is to find the view on the first position. How do I find the view on the last position?

TextView textView = 
  (TextView)myRecyclerView.findViewHo         


        
3条回答
  •  无人及你
    2021-01-29 16:02

    You can try this

    TextView textView = (TextView) myRecyclerView.findViewHolderForAdapterPosition(myRecyclerView.getAdapter().getItemCount() - 1).itemView.findViewById(R.id.myTV);
    

提交回复
热议问题