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

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -