You can't have two different gravity in the same layout, so you can't do it a linear Layout, without introducing a new level in the hierarchy.
I made an entry in my blog on this subject : http://androidblogger.blogspot.com/2009/08/tutorial-how-to-have-two-buttons-on.html Hope it helps, Emmanuel On Oct 30, 12:36 am, Jason Proctor <jason.android.li...@gmail.com> wrote: > i have a linear layout with two buttons. i'd like the first to be at > the left edge of the container, and the right to be at the... right > edge. layout gravity is advertised to do this but i don't seem to be > able to influence placement with it at all. i've had the gravity > affect the text inside the buttons, which is a bit weird, but it no > longer seems to do that... > > <LinearLayout > android:orientation="horizontal" > android:layout_width="fill_parent" > android:layout_height="wrap_content" > > > <Button > android:id="@+id/auth_login_button" > android:layout_height="50dip" > android:layout_width="100dip" > android:layout_gravity="left" > android:text="@string/auth_login_label" > android:textColor="#ffffff" > android:background="#0000ff" > android:textStyle="bold" > /> > > <Button > android:id="@+id/auth_signup_button" > android:layout_height="50dip" > android:layout_width="100dip" > android:layout_gravity="right" > android:text="@string/auth_signup_label" > android:textColor="#ffffff" > android:background="#0000ff" > android:textStyle="bold" > /> > </LinearLayout> > > -- > jason.vp.engineering.particle -- 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