I am implementing ListView
with android:listSelector
<style name="ListView" parent="@android:style/Widget.ListView">
<item name="android:cacheColorHint">@color/transparent</item>
<item name="android:divider">@drawable/divider</item>
<item name="android:dividerHeight">1px</item>
<item name="android:listSelector">@color/red</item>
</style>
Selecting works fine, but when I start scrolling, listSelector
will randomly hang to top or bottom of ListView
. I would appreciate any help.
The main problem is that you are using a solid color instead of using Drawables. It is a drawback in the layout framework that if you set the solid colors, then the problem of hold occurs.
The code which you are using as :
should be used as :
The above written drawable should be enclosed in the selector tag.
Here is the code for the list_view_selector
Note : You cannot use the solid color as it is. You have to make the selectors for the each color tone as :
I have checked this at my end. Working Perfect!!