How to use custom color for each textview in listview that extends SimpleAdapter in Android ?
Posted
by mob-king
on Stack Overflow
See other posts from Stack Overflow
or by mob-king
Published on 2010-05-31T14:44:38Z
Indexed on
2010/05/31
15:43 UTC
Read the original article
Hit count: 285
android
I have a listview with custom rows and that extends SimpleAdapter. Each row consist of two linear layouts : 1st having two textviews of which one is hidden in horizontal orientation, second having two textviews in horizontal orientation. Now depending on the value in hidden textview , I want to setcolor for the remaining items for the row. To put it as simple: each listview item has some custom colors the value of which comes from the hidden field.
I have done this by overriding getview() for the simpleadapter and returning view for each, but this makes list very slow to render (and that I think is obvious as so much of work for each view before showing it).
Can I do this in some more efficient way ? like making views and then add up to list instead of using xml layout maybe one solution OR any other ? Any help ? Thanks.
© Stack Overflow or respective owner