简体   繁体   English

奇怪的ListView滚动问题

[英]Strange ListView scrolling issues

I have a ListView in my app that has a background image. 我的应用程序中有一个具有背景图像的ListView。 All of the rows are a semi transparent white (#35FFFFFF). 所有行均为半透明白色(#35FFFFFF)。 Whenever I scroll the list, the rows turn a light green that obscures the background image until I stop scrolling (usually--sort of unpredictable). 每当我滚动列表时,行就会变成浅绿色,这会遮住背景图像,直到我停止滚动(通常是不可预测的)。 Sometimes it flickers between the background image/color and the green. 有时,它会在背景图像/颜色和绿色之间闪烁。 And yes, I have set the cache color hint to #00000000. 是的,我已将缓存颜色提示设置为#00000000。 Any advice about this would be appreciated. 任何建议对此将不胜感激。

ListView xml: ListView xml:

<ListView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/list"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:padding="7px"        
    android:cacheColorHint="#00000000"
    android:dividerHeight="6px"
    android:"#75ffffff"
    android:background="@drawable/list_bg"
    android:fastScrollEnabled="true"
    />

Row xml: 行xml:

<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/text"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:textSize="18px"
    android:textColor="@android:color/black"
    android:gravity="center_vertical"
    android:background="#35ffffff"
    />

Bitmap xml: 位图xml:

<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
    android:src="@drawable/list_bg_bitmap"
    android:tileMode="repeat"
    android:dither="true"
    />

try this one: 试试这个:

<ListView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/list"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:padding="7px"        
    android:cacheColorHint="#00000000"
    android:dividerHeight="6px"
    android:"#75ffffff"
    android:background="@drawable/list_bg"
    android:fastScrollEnabled="true"

    android:drawSelectorOnTop="false"
    />

Check out this link. 查看此链接。 Sounds like what you are having. 听起来像您所拥有的。 It discusses cacheColorHint. 它讨论了cacheColorHint。 That mighe be your fix. 那米格是你的解决办法。 http://developer.android.com/resources/articles/listview-backgrounds.html http://developer.android.com/resources/articles/listview-backgrounds.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM