我從模擬器的SD卡retrived的圖像,並添加到我的網view.but他們沒有得到顯示適當的方式![在這裏輸入的形象描述] [1]如何調整imageview?
能否請你幫我.. 此外,我貼我的ImageAdapter.java 請建議在它的任何變化.. 感謝
public class ImageAdapter extends BaseAdapter
{
ArrayList<Images> array=new ArrayList<Images>();
Context mContext;
private LayoutInflater mInflater;
public ImageAdapter(Context c,ArrayList<Images> arr)
{
mContext = c;
array=arr;
mInflater = LayoutInflater.from(mContext);
Log.e("","adapter con");
}
public int getCount()
{
Log.e("Count",""+array.size());
return array.size();
}
public Object getItem(int index)
{
//return 0;
return array.get(index);
}
public long getItemId(int index)
{
return index;
}
public View getView(int position, View convertView, ViewGroup parent) {
// RelativeLayout.LayoutParams layoutParams =new //RelativeLayout.LayoutParams(30, 30);
ImageView imageView = new ImageView(mContext);
Images i=array.get(position);
imageView.setImageBitmap(i.getBitmap());
imageView.setScaleType(ImageView.ScaleType.FIT_XY);
imageView.animate();
// imageView.setLayoutParams(layoutParams);
return imageView;
}
}
圖像不附 –
我是新用戶,DNT有太多的聲譽。所以不要讓我附上圖片 –
那麼任何其他方式告訴是什麼問題? –