以下代碼是查找第一個位置的視圖。我如何找到最後位置的觀點?查找關於RecyclerView最後位置的視圖?
TextView textView =
(TextView)myRecyclerView.findViewHolderForAdapterPosition(0).itemView.findViewById(R.id.myTV); //this is first position
,這裏是我的xml
<android.support.v7.widget.RecyclerView
android:id="@+id/messageRecyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:nestedScrollingEnabled="false" />
使用recyclerview大小或長度 –
@jigarsavaliya你能不能給示例代碼請?我會立即接受工作答案。 –
提供您的適配器 –