Thom,

This is working as intended.

layout_weight makes LinearLayout expand child view sizes.

However, it does not affect padding or margin values.

AFAIK, there is no easy way to do what you're looking for - which is scaling the entire layout, including padding, and margin values (and presumably font sizes too).

And which seems like a pretty strange thing to want to do - a larger screen lets you fit more content, but that content is inside the views, not between them. So the views growing and the spacing staying visually the same is actually what one would expect (and I'm saying this with my "user" hat on).

In case I'm missing something in your the usage scenario, well, you could write your own layout (a subclass of ViewGroup) to scale all of the above according to screen size.

-- Kostya

19.03.2011 22:15, Thom Shutt пишет:
I tried initially without - the problem is just extended to the pink
boxes, and I end up with a massive white gap at the bottom of the
screen on larger displays.

On Mar 19, 11:44 am, lbendlin<l...@bendlin.us>  wrote:
You may want to try this without weighting.

On Mar 18, 6:57 pm, Thom Shutt<thomshuttimper...@gmail.com>  wrote:

Hi,
I'm having some issues with using DPs. The problem may be with my
understanding of them.
I'm only using weighting and DPs for my layout. The weighting works
well when scaling to different displays, but anything that isn't using
weighting (text, space between the elements) doesn't scale
proportionally - you can see the difference in the pictures below when
I switch from the 2.7in QVGA to 5.4in FWVGA.
http://i54.tinypic.com/14t1lrk.png
http://i54.tinypic.com/2mfkvug.png
It's my current understanding that by using DPs rather than standard
pixel units, element size rations should be maintained across
different resolutions.


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

Reply via email to