标签:find nbsp lan out tsv on() recycle 还需 fir
我们在使用RecyclerView时,有时候还需要获取某个Item的viewHolder,具体如下:
int firstItemPosition = layoutManager.findFirstVisibleItemPosition();
if (position - firstItemPosition >= 0) {
//得到要更新的item的view
View view = mRecyclerView.getChildAt(position - firstItemPosition+1);
if (null != mRecyclerView.getChildViewHolder(view)){
ProductsViewHolder viewHolder = (ProductsViewHolder)mRecyclerView.getChildViewHolder(view);
//do something
}
再分享一下我老师大神的人工智能教程吧。零基础!通俗易懂!风趣幽默!还带黄段子!希望你也加入到我们人工智能的队伍中来!http://www.captainbed.net
android RecyclerView获得单个Item的ViewHolder
标签:find nbsp lan out tsv on() recycle 还需 fir
原文地址:https://www.cnblogs.com/skiwnchhw/p/10471681.html