Artem
Artem

Reputation: 239

How to disable header view in ListView

Anybody knows how to disable the header view in list view? I need to add a header into a list view and make it not clickable. For adapter it's pretty simple: return false in isEnabled(int position) method but I didn't find an appropriate function for list headers/footers. Setting enabled flag for header view didn't help, nor did specifying "android:descendantFocusability="blocksDescendants"" in header's xml

Upvotes: 8

Views: 3767

Answers (1)

Vineet Shukla
Vineet Shukla

Reputation: 24031

use these methods to add header and footer in list:

list.addFooterView(v);
list.addHeaderView(v, data, isSelectable);

Upvotes: 23

Related Questions