aspose file tools*
The moose likes Android and the fly likes fill_parent vs. allignPrentTop/Bottom Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "fill_parent vs. allignPrentTop/Bottom" Watch "fill_parent vs. allignPrentTop/Bottom" New topic
Author

fill_parent vs. allignPrentTop/Bottom

Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 6109
    
    6

In a tutorial on Android layouts (http://www.curious-creature.org/2009/02/22/android-layout-tricks-1/) I saw the following:



As I understand it, layout_height="fill_parent" means that the view will fill its parent vertically (no leap in logic there). That is, its top edge will align with the parent's top edge and its bottom edge will align with the parent's bottom edge.

And, as I understand it, the two alignParentXxx parameters also mean the the view's top and bottom edges will be aligned with those of its parent.

So, what's the difference? And why use both height and align?
Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 6109
    
    6

Bump...
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 9990
    
    7

Disclaimer: I mostly use DroidDraw to get the basic layout and then tweak manually as required.

I think align top/bottom gives you finer control. top+bottom = fill parent. However you might have scenarios where you do not want fill parent but align top/bottom.


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 6109
    
    6

Thanks Maneesh. I'll check it out.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: fill_parent vs. allignPrentTop/Bottom
 
Similar Threads
Putting tabs below the screen
Another method invocation question...
TabHost repeating tab content
hiding views and re-layouting their parent - how?
Layout question.