[英]Unable to scroll smoothly listView of Images in android 4.1
我正在使用圖像的listView滾動圖像,listView可以在2.3上平滑滾動,但不能在OS 4.0+的手機上滾動。 所有圖像都從R.drawable中獲取請找到我的代碼
image_list.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#A4A4A4"
android:orientation="horizontal" >
<ImageView
android:id="@+id/imageStatus"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:adjustViewBounds="true"
android:scaleType="fitXY" />
</LinearLayout>
嘗試使用SparseArray<E>
以獲得可繪制圖像列表的更好性能。
嘗試將其添加到您的listview中:
android:cacheColorHint="@android:color/transparent"
這消除了滾動列表時的閃爍...
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.