Android: How to disable ListView?
Asked Answered
W

3

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?

Why answered 17/6, 2011 at 23:8 Comment(0)
B
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
Borders answered 17/6, 2011 at 23:19 Comment(0)
R
2

all the easier! list.setEnabled(false)

Rite answered 8/6, 2014 at 23:1 Comment(1)
This makes the list un-scrollable it doesn't merely disable the items.Clancy
V
1

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

Veranda answered 17/6, 2011 at 23:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.