我已经从模拟器的 sdcard 中检索图像并添加到我的网格视图中。但它们没有以正确的方式显示。![在此处输入图像描述][1]
你能帮我吗..我还发布了我的 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;
}
}