Android, how to make two buttons next to each other with the same width
- by user3674127
Im trying to place two buttons on the xml next to each other and I want them both to be the same size(half from the width of the screen) - this is my xml:
<LinearLayout
android:layout_width="fill_parent"
android:orientation="horizontal"
android:id="@+id/linearLayout2"
android:layout_height="fill_parent"
android:gravity="bottom"
android:weightSum="2">
<Button
android:layout_weight="1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/bAddDelete"
/>
<Button
android:layout_weight="1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/bMainMenu"
/>
</LinearLayout>
Everything works well, but when im changing the text in java, the width is changing, how can I make them the same size?
Thanks