I know that this topic has been covered many times in this group, but
I still have a question I'm hoping to get answered.  Referring to this
thread,
http://groups.google.com/group/android-developers/browse_thread/thread/3bfb013704d886fb/a556ab75f22c8dd1

hackbod wrote:
The ScrollView gives its contents an infinite amount of
vertical space to layout in, so what you might expect to have happen
is for the ListView to resize itself to be able to contain all of its
items...  but this would mean having to load all of the data from its
adapter, and instantiate and layout a view for every one, which for
long lists is almost certainly not what you want (which is why it
asserts), and anyway if you are going to end up with that then you
might as well just put all of the items into the scroll view without
having a list view there at all.

I understand this, but there are benefits to using ListView beyond the
scrollability.  I mostly want to use a ListView for its AdapterView
characteristics.  If I were to simply use a vertical LinearLayout,
moving and deleting elements inside of the LinearLayout is more prone
to issues/maintainability than with an AdapterView.

So I would like to have all the views in the ListView loaded and
displayed if possible.  I've managed this by instantiating and
measuring each element inside of the ListView when onMeasure is called
on the ListView, adding them all up (and padding for dividers), and
setting the measured height, but this doesn't seem like an ideal
solution.  Any tips?

Maybe it's as simple as using a different AdapterView that I don't
know about?
--~--~---------~--~----~------------~-------~--~----~
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
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to