WEB开发网
开发学院手机开发Android 开发 android平台的左右上下都能滚动的效果 阅读

android平台的左右上下都能滚动的效果

 2013-08-09 11:50:31 来源:WEB开发网   
核心提示:return gbList.get(position);}public long getItemId(int position) {return position;}@TargetApi(Build.VERSION_CODES.HONEYCOMB)@SuppressLint("NewApi")pub
return gbList.get(position);
}

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);

}

}
}

上一页  1 2 3 

Tags:android 平台 左右

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接