Monday, May 31, 2010

[android-developers] Re: Linear Layout

Try setting layout_weight="1" on the items following the one that is
asking for the full height.

That will tell the LinearLayout that those items need some space also.

On May 31, 7:43 am, Anton Persson <> wrote:
> Hello,
> I have a set of custom views that I would like to add to a LinearLayout
> object. However, the first object I add to the layout (I do this
> dynamically, during runtime) has a OnMeasure method that tries to get as
> much space as possible resulting in that it get's all the space LinearLayout
> object. This is correct behaviour, but when I then add more objects
> following that I want the allocated area for the first object to decrease so
> the others will fit.
> As it is now, each following object will get zero space, and hence won't be
> visible.
> Can this be solved somehow?
>    Best Regards
>     Anton

You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

No comments:

Post a Comment