[android-developers] Re: multiple layout in listview
Right thank you. I'll have to take a look.
On 2 nov, 13:01, Kostya Vasilyev <kmans...@gmail.com> wrote:
> If the difference is small (as seems to be in this case, at least for
> now), you can change view attributes in getView(). Just make sure to get
> both code paths, for when there is a recycled view and when there isn't.
>
> The general way to do this is to override getViewTypeCount and
> getItemViewType in the adapter.
>
> Inflate the right kind of layout in getView for when there is no
> recycling. If there is recycling, the view type as returned by
> getItemViewType, is automatically considered by ListView.
>
> -- Kostya
>
> 02.11.2010 14:32, лойк пишет:
>
> > My problem is quite simple. Though not sure if I can do anything about
> > it yet.
>
> > I want to handle a list of messages. When its me i use layout_right
> > and when it's a friend layout_left.
>
> > It works except because of recycling only first items will be rights.
>
> > So my question is how could i recycle views with 2 layouts and pick
> > the right one. I could keep a list but I'm scared it could grow
> > without freeing memory.
>
> --
> Kostya Vasilyev -- WiFi Manager + pretty widget --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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home