android平台的左右上下都能滚动的效果
2013-08-09 11:50:31 来源:WEB开发网}
public long getItemId(int position) {
return position;
}
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
@SuppressLint("NewApi")
public View getView(int position, View convertView, ViewGroup parent) {
Log.i("AAA","position = "+position);
TeamBean item = gbList.get(position);
Log.i("AAA","getView() , item = "+item);
CellHolder cellHolder;
if (convertView == null) {
cellHolder = new CellHolder();
convertView = mInflater.inflate(R.layout.team_item, null);
cellHolder.ivIcon = (ImageView) convertView
.findViewById(R.id.ivIcon);
cellHolder.name = (TextView) convertView
.findViewById(R.id.name);
convertView.setTag(cellHolder);
} else {
cellHolder = (CellHolder) convertView.getTag();
}
cellHolder.ivIcon.setImageResource(R.drawable.icos5);
cellHolder.name.setText(item.getName());
cellHolder.name.setTextSize(12);
return convertView;
}
}
private class CellHolder {
ImageView ivIcon;
TextView name;
}
private class ItemClickEvent implements OnItemClickListener {
public void onItemClick(AdapterView<?> parent, View view, int position,
long id) {
Log.i("item","parent = "+parent+", view = "+view+", position = "+position);
}
}
}
赞助商链接