5

I have a list view and want each cell in my within it to be disabled so that when you tap on it the text colors stay the same.

But I want it to be scrollable.

How can I achieve this?

Grant Thomas
  • 44,454
  • 10
  • 85
  • 129
aryaxt
  • 76,198
  • 92
  • 293
  • 442

3 Answers3

8

This similar post might be of help. The general approach is to disable all the items instead of the whole view. Essentially:

  • Inherit from ArrayAdapter (or any other adapter)
  • Override isEnabled(int position) to return false
  • Override areAllItemsEnabled() to return false
Community
  • 1
  • 1
kabuko
  • 36,028
  • 10
  • 80
  • 93
2

all the easier! list.setEnabled(false)

Master
  • 690
  • 6
  • 18
1

Did you try adding android:clickable="false" to the list view's rows?

Stefan Bossbaly
  • 6,682
  • 9
  • 53
  • 82