What works for me is something like this:
res/layout/item_layout.xml
<LinearLayout id=@"+id/item_top">
<LinearLayout id=@"+id/item_root">
<TextView1> <TextView2> etc.
</LinearLayout>
</LinearLayout>
Now in getItem(), I change the background of R.id.item_root, not of
R.id.item_top (which is left intact).
-- Kostya
27.04.2011 22:59, Kumar Bibek пишет:
I am a little confused here.
I inflate a layout, which has a single TextView inside a LinearLayout.
In the adapter, I use the convertView to recycle views, so, now I
don't try to change the convertView's backgound, rather, I am now
changing the LinearLayout's background. I also tried to change the
TextView's background. Similar results. I have started feeling that
there's a silly mistake somewhere, which I am not able to detect.
However, strangely enough, the Logs say everything's fine.
Kumar Bibek
http://techdroid.kbeanie.com
http://www.kbeanie.com
On Thu, Apr 28, 2011 at 12:19 AM, Kostya Vasilyev <[email protected]
<mailto:[email protected]>> wrote:
27.04.2011 22:44, Kumar Bibek пишет:
Hmm, I tried injecting a view group at the root of the items,
but still it doesn't work. Weird.
Did you adjust the code to change the background of this newly
injected view group? And leave the root view group alone?
When I put logs, correct view types get returned, and morever,
the gravity stuff works fine, but the backgrounds just dont work.
Damn!! I thought I knew list views very well.
Kumar Bibek
http://techdroid.kbeanie.com
http://www.kbeanie.com
--
Kostya Vasilyev -- http://kmansoft.wordpress.com
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to
[email protected]
<mailto:[email protected]>
To unsubscribe from this group, send email to
[email protected]
<mailto:android-developers%[email protected]>
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--
Kostya Vasilyev -- http://kmansoft.wordpress.com
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en