0
你好,我想從設備獲取的圖像和網格視圖中顯示它時,我改變我對3拿給我的3五倍位置的圖像:我想補充的位圖圖像列表變爲網格視圖
BitmapFactory.decodeStream(new FileInputStream(file[i]));
private OpenDownloadedImages MyContext;
ArrayList<Bitmap> bitmaps = new ArrayList<Bitmap>();
public buttonAdapter(OpenDownloadedImages c){
MyContext = c;
}
@Override
public int getCount() {
return file.length;
}
@Override
public Object getItem(int i) {
return file[i];
}
@Override
public long getItemId(int i) {
return i;
}
@Override
public View getView(int i, View view, ViewGroup viewGroup) {
LayoutInflater inflater = getLayoutInflater();
View vie = inflater.inflate(R.layout.row_list_fav,null);
ImageView imageView = (ImageView) vie.findViewById(R.id.imgFav);
imageView.setLayoutParams(new GridView.LayoutParams(180,250));
imageView.setScaleType(ImageView.ScaleType.FIT_XY);
imageView.setPadding(0,0,0,0);
try {
File f=new File("sdcard/wallpaperHD");
File file[] = f.listFiles();
Bitmap b = BitmapFactory.decodeStream(new FileInputStream(file[i]));
//ImageView img=(ImageView)findViewById(R.id.dImage);
//img.setImageBitmap(b);
imageView.setImageBitmap(b);
}
catch (FileNotFoundException e)
{
e.printStackTrace();
}
return imageView;
}
File f=new File("sdcard/wallpaperHD");
File file[] = f.listFiles();
}
謝謝!
您可以附加屏幕截圖嗎?我很困惑你的意思是「它向我展示三次5次的圖像」 –
應該如此。很好的噱頭。添加一個六點一來獲得更多樂趣!有什麼問題嗎? – greenapps