tinyang wrote: > Hi, when formatting the layout in xml, how do I center an element? I > looked in Declaring layout section of the dev guide, but I only saw ways > to define an absolute postion. Is there a way to center an element so > that if the orientation is changes or the activity is viewed on a > different sized screen/device, it can auto center itself?
Put it inside a RelativeLayout and use android:layout_centerInParent="true". -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy _Android Programming Tutorials_ Version 1.0 In Print! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~----------~----~----~----~------~----~------~--~---