/**
* 创建新View,被LayoutManager所调用
*/@OverridepublicViewHolderonCreateViewHolder(ViewGroup parent,intviewType){// View view = View.inflate(parent.getContext(), R.layout.item_fra_main2, null);View view = mInflater.from(mContext).inflate(R.layout.item_fra_main2, parent,false);
ViewHolder holder =newViewHolder(view);returnholder;
}
使用这种方式inflate item
网友评论