Android: Gallery的adapter中getView方法被执行多次
项目中遇到一个奇怪的问题:为Gallery设置的adapter中的getView方法被调用多次
客户需求:一次只能滑动一格
参考资料:
https://stackoverflow.com/questions/4687370/gallery-scroll-one-image-at-a-time
https://stackoverflow.com/questions/6058609/android-gallerys-getview-returning-incorrect-position
Android Adapter multiple getView
https://stackoverflow.com/questions/3196219/android-adapter-multiple-getview
android listview中getView重复被调用的问题
<RelativeLayout xmlns:android="https://schemas.android.com/apk/res/android" android:id="@+id/RelativeLayout1" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:background="@drawable/repeat_bg">
<ListView
android:id="@+id/friend_list" android:layout_width="fill_parent" android:layout_height="fill_parent"
android:layout_weight="1" android:cacheColorHint="#00000000" android:divider="#CCCCCC" android:fastScrollEnabled="true" android:focusableInTouchMode="true" />
</RelativeLayout>
<LinearLayout xmlns:android="https://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#f3f3f3" android:orientation="vertical" > <ListView android:id="@+id/requestObjLV" android:layout_width="fill_parent" android:layout_height="0dip" android:layout_weight="1" android:cacheColorHint="#00000000" android:divider="#CCCCCC" /> </LinearLayout>
当ListView\GridView设置固定大小,就不会多次调用了~
最后更新:2017-04-04 07:03:25