2009-03-21 



ljm189 



发件人: markdsievers 
发送时间: 2009-03-21  08:02:53 
收件人: Android Developers 
抄送: 
主题: [android-developers] Re: ListViews getting rendered multiple times 
 
Hi Romain,

Thanks for your response, though I had a couple of questions for you;

1) None of the LinearLayout's contain the layout_wieght attribute...So
I'm not sure that's my problem.

2) Could you please breifly explain the logic behind why the framework
requires n passes over the ListViws items?

3) Give that this is an overhead, can you suggest an approach that
does not suffer this?

Thanks in advance,

Mark Sievers

On Mar 18, 4:09燼m, Romain Guy  <[email protected] > wrote:
> This is expected if you use layout_weight in your linearlayout for instance.
>
>
>
> On Mon, Mar 16, 2009 at 7:42 PM, markdsievers  <[email protected] > 
> wrote:
>
>  > So the situation is this, I have aListViewthat is embedded in two
>  > LinearLayout ViewGroups to form a screen. BaseAdapter.getView() (the
>  > implementation of the ListAdapter) is typically called n times (where
>  > n is numElements) to render the screen. The problem I have is this set
>  > of calls is being repeated for every ViewGroup that the list is
>  > contained in...So for a Layout like this:
>
>  > -LinearLayout
>  > --Linearlayout
>  > ---ListView
>
>  > The adapters getView() is being called n*3 times (3 = 1 for the parent
>  > LinerarLayout, one for the child LinearLayout and one for the List
>  > itself).
>
>  > This is obvisouly a problem when the items in the List are expensive
>  > to build (even with recycling).
>
>  > So Im looking for some guidance on this, as the documentation doesnt
>  > seem to note this behaviour from what I can see.
>
>  > A small, basic example of the source is located on my post here
>  >http://www.anddev.org/listview_getting_rendered_multiple_times-t5290....
>  > with more details aswel as a ready made eclipse project(also attached
>  > below) if anyone is keen to try it out.
>
> --
> Romain Guy
> Android framework engineer
> [email protected]
>
> Note: please don't send private questions to me, as I don't have time
> to provide private support. 燗ll such questions should be posted on
> public forums, where I and others can see and answer them

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to