public View getView(int position, View convertView, ViewGroup parent)
{
ImageView img;
if (convertView == null)
{ // if it's not recycled, initialize some attributes
img = new ImageView(mContext);
img.setLayoutParams(new GridView.LayoutParams(85, 85));
img.setScaleType(ImageView.ScaleType.CENTER_CROP);
img.setPadding(8, 8, 8, 8);
}
else
{
img = (ImageView) convertView;
}
img.setImageResource(mThumbId[position]);
return img;
}
質問する
103 次