In my Android app I want to create a dialog window that contains an image on top, some info text in the middle, and two buttons below. These two buttons are within a linear layout with vertical orientation. Both sould be of the same width.
I have managed to create a similar layout as described, however, the button with the longer text on it becomes wider than the other one. In the attached picture, the lower button is a bit wider than the button above, as marked by the dotted red line.

The layout I use for this inner linear layout looks as follows:
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<Button
android:id="@+id/close_dialog_button_ok"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/upload_dialog_ok"
android:layout_marginLeft="10dip"
android:layout_marginRight="10dip"
android:layout_marginTop="10dip" />
<Button
android:id="@+id/close_dialog_button_cancel"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/upload_dialog_cancel"
android:layout_marginRight="10dip"
android:layout_marginTop="10dip"
android:layout_marginBottom="5dip" />
</LinearLayout>
Any ideas what I am doing wrong here?
Thanks in advance for your help!
You forgot to set
android:layout_marginLeft="10dip"on the second button