【发布时间】:2015-05-30 17:23:27
【问题描述】:
大家好,我对 Android 开发非常缺乏经验,所以我需要你的帮助 :)
问题
我希望用户能够看到图像列表,但一旦他们滚动我希望他们能够转到下一张图像而不是滑动太多并跳过图像
问题
那么有没有办法让滚动速度变慢或者 HorizontalScrollView 不是我想要的那种视图来实现我想要的东西?
我的代码
<HorizontalScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:id="@+id/scrollView">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/sample_0"
android:id="@+id/dog"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/sample_1"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/sample_2" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/sample_3"/>
</LinearLayout>
</HorizontalScrollView>
【问题讨论】: