sdphil wrote: > i want a button on the left hand side, a button on the right hand side > and some text centered in the middle -- seems so straightforward! :) > I never see the button on the right hand side. > > <LinearLayout android:orientation="horizontal" > android:layout_centerVertical="true" > android:layout_width="fill_parent" > android:layout_height="35px"> > > <ImageButton android:id="@+id/Btn1" > android:layout_width="wrap_content" > android:layout_height="fill_parent" > android:src="@drawable/btn1" > android:background="@color/transparent"/> > > <TextView android:id="@+id/CenteredText" > style="@style/top_title" > android:layout_width="fill_parent"
In the preceding line, you have told Android to have this TextView take up the whole rest of the row. I suspect that is not what you want, since that will mean the following ImageButton will not display. > android:layout_height="wrap_content" > android:gravity="center_horizontal" > android:text="CENTERED TEXT"/> > > <ImageButton android:id="@+id/Btn2" > android:layout_width="wrap_content" > android:layout_height="fill_parent" > android:src="@drawable/btn2" > android:background="@color/transparent"/> > > </LinearLayout> Consider using RelativeLayout. It has attributes specifically for your scenario (attaching items to the left, right, and center of the parent container). -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Looking for Android opportunities? http://wiki.andmob.org/hado --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

