I want to disable the Selector
from my ListView
. That's when I click any items there will be no indication that it has been clicked.
I tried this in my ListView tag:
android:listSelector="@null"
and didn't work
I want to disable the Selector
from my ListView
. That's when I click any items there will be no indication that it has been clicked.
I tried this in my ListView tag:
android:listSelector="@null"
and didn't work
set this android:listSelector="#00000000" Try this.
The above answer from Kalpana is correct. You can also do it in code like this:-
myListView.setSelector(new ColorDrawable(0x0));
You could create a new drawable to use as selector, that wouldn't have any state in it :
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@android:color/background_dark" />
</selector>
and then set it using the android:listSelector attribute. You can reference one of the android colors as the background color in your selector : http://developer.android.com/reference/android/R.color.html
© 2022 - 2024 — McMap. All rights reserved.