My layout code as below:
<LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:gravity="center_vertical"
android:orientation="horizontal" >
<Button
android:id="@+id/btn_left"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:text="Phone Files" />
<TextView
android:id="@+id/list_title"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:gravity="center_horizontal"
android:text="Photos"
android:textAppearance="?android:attr/textAppearanceLarge" />
<Button
android:id="@+id/btn_right"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:text="Save" />
</LinearLayout>
How to let the btn_left and btn_right have the same size?
If there is no any more importance of weight then just remove the weight from your layout and give equal size to that both Button.
See Below:
Edited:
Create the String in to your string.xml file
as like:
then Put the Below code and it will show you the Button with two line text.
Hope it works as you want.
Thanks.
Enjoy.