I have a rather involved requirement for a rather simple layout. I have an 
activity with a single ListView floating in the middle of the screen with a 
background margin of uniform width all around. So far no problem. Now I need 
the margin to be as large as possible given the content of the ListView, but 
always equal all around. Furthermore, if the ListView contents are higher 
than the screen, then there needs to be a minimum margin (that is, the 
margin cannot shrink to zero). Another way of stating the problem: the 
ListView should be nominally sized to wrap_content, except it should then 
expand in x or y as necessary to equalize the margins.

Without the equal-all-around requirement, or without the 
margin-as-large-as-possible requirement, this would all be fairly simple to 
do using layout_weight. Is there a way to implement both requirements? (In 
XML with stock UI elements, that is; I know I could do this in code.)

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to