我正在尝试开发一款能够在ViewFlipper上显示所有图库图片的Android应用。 在发布之前我做了一些搜索,但是我找不到我要找的东西,所有的例子都显示了这样的静态图像:
<ViewFlipper
android:id="@+id/flipper1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:flipInterval="3000"
android:inAnimation="@anim/slide_in_right"
android:outAnimation="@anim/slide_out_left"
android:layout_centerInParent="true" >
<ImageView
android:src="@drawable/img1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:contentDescription="@string/str_img1"
android:layout_gravity="center_horizontal" />
<ImageView
android:src="@drawable/img2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:contentDescription="@string/str_img2"
android:layout_gravity="center_horizontal" />
<ImageView
android:src="@drawable/img3"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:contentDescription="@string/str_img3"
android:layout_gravity="center_horizontal" />
<ImageView
android:src="@drawable/img4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/str_img4"
android:layout_gravity="center_horizontal" />
<ImageView
android:src="@drawable/img5"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:contentDescription="@string/str_img5"
android:layout_gravity="center_horizontal" />
</ViewFlipper>
我想要做的只是从图库中选择一个图像,然后向右/向左滑动以查看图库内容。