1
내 이미지가 Coverflow에 표시되지 않는 이유가 궁금합니다. 어떤 아이디어? 이것은 안드로이드 갤러리 애플 리케이션을 기반으로 coverflow입니다. R.drawable에서 소스로 이미지를 가져 왔습니다. SD 카드에서 이미지를 가져 오는 것으로 변경했습니다. 나는 저자가 추천 한 코드를 어떻게 사용하는지 모른다. 여기 Coverflow 용 SD 카드와 같이 R.drawable에서 외부 소스로 이미지 소스를 변경합니다.
은 외부 소스에서 코드를 촬영하는 방법에 원래 저자의 예는 다음과 같습니다 //Use this code if you want to load from resources
ImageView i = new ImageView(mContext);
i.setImageResource(mImageIds[position]);
i.setLayoutParams(new CoverFlow.LayoutParams(130, 130));
i.setScaleType(ImageView.ScaleType.MATRIX);
return i;
여기에 내가 그것을 시도하는 방법이다 : 먼저 R.drawable 참조의 코드를 주석 을;
public class ImageAdapter extends BaseAdapter {
int mGalleryItemBackground;
private Context mContext;
private FileInputStream fis;
private Integer[] mImageIds = {
// R.drawable.pic01,
// R.drawable.pic02,
// R.drawable.pic03,
// R.drawable.pic04,
// R.drawable.pic05,
// R.drawable.pic06,
// R.drawable.pic07,
// R.drawable.pic08,
// R.drawable.pic09
};
private ImageView[] mImages;
public View getView(int position, View convertView, ViewGroup parent) {
ImageView i = new ImageView(mContext.getApplicationContext());
imagecursor.moveToPosition(position);
int id = imagecursor.getInt(image_column_index);
i.setImageURIUri.withAppendedPathMediaStore.Images.Media.EXTERNAL_CONTENT_URI, ""+ id));
i.setLayoutParams(new CoverFlow.LayoutParams(130, 130));
i.setScaleType(ImageView.ScaleType.MATRIX);
return i;
//return mImages[position];
}