Greetings.

I have a ListActivity which contains elements inside a table layout,
looking something like this:
LinearLayout
> ImageView
> TableView
>> TableRow
>>> LinearLayout
>>>> TextView
>> TableRow
>>> LinearLayout
... (some more rows here)

Now I want to place an icon after the text in the TextView. This icon
may or may not be available depending on the input data, so I figured
the most optimal would be to show the icon as a compound drawable.
However, when doing this via code (setCompoundDrawables) the drawable
does not show up. If I do it via the UI editor it'll be there, on all
rows of course. I have a hunch that I need to re-layout the TextView
after changing compound drawables but neither requestLayout nor
invalidate solved it for me. I haven't tested this yet but slapping a
good old ImageView after the TextView will most likely do the trick.
If I DO have to re-layout the TextView and/or the TableView, will it
still be more optimal than the added view from an ImageView?

And oh, another question. Since this icon reduces the optimization
given by the "view holder" trick, are there any other ways of dealing
with list items which to some degree have dynamic number of visible
views?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to