private class ViewHolder extends RecyclerView.ViewHolder { private TextView tv_name;
public ViewHolder(View itemView) {
super(itemView);
tv_name = itemView.findViewById(R.id.tv_name);
}
}
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
if (holder instanceof ViewHolder) {
Bean bean = mlist.get(position);
((ViewHolder) holder).tv_name.setText(bean.getTdi_name());
}
}
为什么我在ViewHolder类private声明的控件 能直接被.调用,有点无法理解,还望指教。
2 回答
- 2 回答
- 0 关注
- 571 浏览
添加回答
举报
0/150
提交
取消