我想为我从 sd 卡检索到的图像并显示在网格视图中的图像视图安排边框。我的默认应用程序看起来像这样没有边框的图像
但我想为应该看起来像这样的屏幕修改它包括带边框的图像
请给我解决方案。我已经为我的 ImageAdapter.java 发布了代码
导入 java.util.ArrayList;
public class ImageAdapter extends BaseAdapter
{
public static 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) {
GridView.LayoutParams layoutParams = new GridView.LayoutParams(80, 80);
ImageView imageView = new ImageView(mContext);
Images i=array.get(position);
imageView.setImageBitmap(i.getBitmap());
imageView.setScaleType(ImageView.ScaleType.FIT_XY);
imageView.animate();
return imageView;
}
}
谢谢