18.10.2010 20:20, FractalBob пишет:
Hi,
I have a ListView that I want to populate with objects whose layout is
defined via XML. Is there a way to instantiate a layout at runtime,
Yes, take a look at LayoutInflater.
editing stuff like the Android layout ID, etc., and then load the new
layout into the list? TIA!
Attributes of a given view can be changed by calling Java methods on
that view: setPadding, setViewId, seVisibility, etc.
Layout attributes normally defined as "layout_blah" in XML can be
changed by calling setLayoutParams.
The "params" need to be of a class that matches the actual parent layout
of that view: LinearLayout.LayoutParams, RelativeLayout.LayoutParams, etc.
Bob
--
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 [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