android - disabling and greying out list items -


i have list view. in list view, have grey out , disable items, , enable rest list items seperate color. how this?

you should write custom adapter extending baseadapter listview. disable items, have override "boolean isenabled(int position)" in adapter, , return false every position you'd disabled.

as changing background color list elements: store background color value in data structure you're displaying. in custom adapter's 'getview()' method, should check color value current element, , return view correct background color set.

or call 'getchildat()' on listview, getting view object desired element in list, , change it's background color. think i'd rather use previous solution.

remember call 'notifydatasetchanged()' on listview's adapter after make changes this.


Comments

Popular posts from this blog

drupal - using views argument in the view tpl.php file -

php - Posting PHPBB Forum Thread/Post info in a website -

php - Add a blog by sending a mail to a certain emailadress -