On Mar 14, 7:52 pm, Mark Murphy <[email protected]> wrote: > skink wrote: > > > On Mar 13, 2:18 pm, Mark Murphy <[email protected]> wrote: > >> Far from dumb -- this is a fine upstanding technique. RelativeLayout > >> supports Z-axis ordering just for this sort of purpose. > > > isn't FrameLayout better for that? > > > you just put in one frame MapView and, on top of this, any layout you > > can imagine > > You can certainly use it, but you may add another level to your View > hierarchy depth. > > *All* FrameLayout can do is Z-axis ordering. RelativeLayout can do > Z-axis ordering *and* other stuff. Moreover, you probably need a > RelativeLayout to position the button where you want, short of trying to > twist gravity in LinearLayouts to meet your needs. > > Given a choice of: > > FrameLayout > -- MapView > -- *Layout (LinearLayout or RelativeLayout) > ----- Button > > or: > > RelativeLayout > -- MapView > -- Button > > the second is more efficient, particularly in terms of stack space and > the dreaded StackOverflowError. > > Now, you could use margins with the Button to shove it into position, > skipping the *Layout. In that case, the two would be equivalent. I'd > still take the RelativeLayout, just for maintainability, but that may be > more a matter of personal preference. > > -- > Mark Murphy (a Commons > Guy)http://commonsware.com|http://twitter.com/commonsguy > > _Android Programming Tutorials_ Version 2.0 Available!
yes, you are right that it adds one more level in tree hierarchy, but still for simple layouts my personal preferense is to use LinearLayouts - maybe because they give you better visualisation of how children are layed out - you dont need to analize each children anchors, at first glance of layout xml file you see everything. but as you said its ones personal preference pskink -- You received this message because you are subscribed to the Google Groups "Android Beginners" group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en

