[android-developers] Re: Fill-remainder layout?
layout_weight="1.0" will cause the view to fill any remaining space. If the view in the middle might be bigger than the available space it will push the bottom row off however. There's a solution for that. Pent -- 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
[android-developers] Re: Fill-remainder layout?
I really think what you're trying to do is most easily expressed as a LinearLayout (itself using width and height to fill parent) using the layout_weight property to make the middle view grab any extra space. If found that it's easy to go overboard with a verbose RelativeLayout when all that's needed is a LinearLayout (and it's probably runs faster to boot). Doug On Dec 24, 9:54 am, John Lussmyer wrote: > Thanks, I did finally get it done with a relative layout. > The only problem I ran into was making sure there were no forward references > in the id's. (Which is why your example had the middle layout at the > bottom.) I was just trying to modify my existing layout, and it had the > middle in the middle! :-) I had to move it to the bottom of the file so it > could reference the bottom panel in it's layout_above entry. > > On Fri, Dec 24, 2010 at 9:06 AM, Kostya Vasilyev wrote: > > 24.12.2010 19:49, Pent пишет: > > > If the view in the middle might be bigger than the available space it > >> will push the bottom row off however. There's a solution for that. > > > This case can be correctly handled by using a RelativeLayout, as I just > > described in my other message. -- 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
Re: [android-developers] Re: Fill-remainder layout?
24.12.2010 19:49, Pent пишет: If the view in the middle might be bigger than the available space it will push the bottom row off however. There's a solution for that. This case can be correctly handled by using a RelativeLayout, as I just described in my other message. -- 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 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
Re: [android-developers] Re: Fill-remainder layout?
Thanks, I did finally get it done with a relative layout. The only problem I ran into was making sure there were no forward references in the id's. (Which is why your example had the middle layout at the bottom.) I was just trying to modify my existing layout, and it had the middle in the middle! :-) I had to move it to the bottom of the file so it could reference the bottom panel in it's layout_above entry. On Fri, Dec 24, 2010 at 9:06 AM, Kostya Vasilyev wrote: > 24.12.2010 19:49, Pent пишет: > > If the view in the middle might be bigger than the available space it >> will push the bottom row off however. There's a solution for that. >> > > This case can be correctly handled by using a RelativeLayout, as I just > described in my other message. > -- 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
Re: [android-developers] Re: Fill-remainder layout?
24.12.2010 20:54, John Lussmyer пишет: The only problem I ran into was making sure there were no forward references in the id's. (Which is why your example had the middle layout at the bottom.) I was just trying to modify my existing layout, and it had the middle in the middle! :-) I had to move it to the bottom of the file so it could reference the bottom panel in it's layout_above entry. You don't *have* to declare an id where it's first used to identify a view (as opposed to referring to it). It's perfectly legal to do this: or even this: Note that view declaration order in XML is the initial Z-order (top-to-bottom is back-to-front), so sometimes forward references are necessary. -- 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 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
Re: [android-developers] Re: Fill-remainder layout?
The layout performance docs say that RelativeLayout is faster due to fewer calls to calculate child dimensions. I actually got it working with a fairly minimal layout definition. On Fri, Dec 24, 2010 at 8:19 PM, Doug wrote: > I really think what you're trying to do is most easily expressed as a > LinearLayout (itself using width and height to fill parent) using the > layout_weight property to make the middle view grab any extra space. > If found that it's easy to go overboard with a verbose RelativeLayout > when all that's needed is a LinearLayout (and it's probably runs > faster to boot). > > -- 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