如何从RECYCLERVIEW访问项目?
(我使用以下语句从listview访问项目:listview.getChildAt(position).findViewById(R.id.txtView).setVisibility(View.VISIBLE);)。
答案 0 :(得分:1)
例如,请将以下类视为ViewHolder
class ViewHolder extends RecyclerView.ViewHolder {
public ImageView imgThumbnail;
public ImageView imgProfIcon;
public TextView tvspecies;
}
您可以从onBindViewHolder
@Override
public void onBindViewHolder(ViewHolder viewHolder, int i) {
viewHolder.tvspecies.setText("Recycler View");
}