سؤال

Today I discovered a strange effect in my Xamarin Android app. The main screen of an app normally looks like this:

normal

As you can see, the main list items are transparent. But when I'm trying to scroll this small list of three items the following ugly effect appears:

bug

List selector for list is set to @color/transparent. List item background is @color/transparent, so I have NO effects when the list item is clicked/focused/enabled/disabled. I also set list android:choiceMode to none. Even with small scrolling gesture all three items are ALWAYS highlighted like this. Note: this bug only occurs when I set target framework to less than API 14 (e.g. for android 3.x support). In android 4.x everything is okay! Please help me to get rid of this.

هل كانت مفيدة؟

المحلول

Just found the culprit, you can either set:

android:cacheColorHint="@android:color/transparent"

or:

android:scrollingCache="false"

for you ListView!

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top