Android的ViewHolder的子类构造函数中为何要super(view)调用父类构造函数? 10
classMyViewHolderextendsRecyclerView.ViewHolder{ImageViewimage;TextViewname;TextViewi...
class MyViewHolder extends RecyclerView.ViewHolder{
ImageView image;
TextView name;
TextView introduce;
public MyViewHolder(View view){
super(view); image=(ImageView)view.findViewById(R.id.image);
name=(TextView)view.findViewById(R.id.name); introduce=(TextView)view.findViewById(R.id.introduce);
}
} 展开
ImageView image;
TextView name;
TextView introduce;
public MyViewHolder(View view){
super(view); image=(ImageView)view.findViewById(R.id.image);
name=(TextView)view.findViewById(R.id.name); introduce=(TextView)view.findViewById(R.id.introduce);
}
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询