Android——打造万能适配器(CommonAdapter)
List<T> : ListView -> Adapter extends BaseAdapter -> ViewHolder
ViewHolder
CommonAdaper
通用的ViewHolder类
convertView.setTag(holder);
ViewHolder:Item各种控件的引用
Map<int, View> -> SpareArray
getView(int id);
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder = ...
TextView tv = holder.getView(viewId);
tv.setText(...);
}
************** 分享技术知识,分享快乐喜悦*******************