我不知道什麼是創造我的應用程序一個圖片庫的最佳途徑。我從RSS源中獲取圖片,並且想要以全屏方式顯示它們中的每一個。我應該使用什麼?我試圖用一個ImageView的,但圖像是在一個糟糕的方式調整(不保留原始尺寸)什麼是Android上最好的方式來創建一個照片庫(全屏)
我用這個答案來實現我的畫廊:Android Gallery fullscreen
感謝的
編輯:
這裏的XML佈局:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<android.support.v4.view.ViewPager
android:id="@+id/galleryPager"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</android.support.v4.view.ViewPager>
</LinearLayout>
,這裏是我在我的適配器使用的代碼加載圖像:
@Override
public Object instantiateItem(View collection, int position) {
ImageView imageView = new ImageView(context);
imageView.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
imageView.setScaleType(ImageView.ScaleType.FIT_XY);
ImageDownloader.getInstance().download(gallery.get(position), ImageFormat.CONTENT_316, imageView);
((ViewPager) collection).addView(imageView, 0);
return imageView;
}
別人留下評論暗示它,這已經很明顯了刪除。 – FoamyGuy 2012-07-13 14:17:12