I have 6 buttons. The XML is as follows for each one. How to go about changing them so that the button text is centered and the they are all the same size?
I assumed that setting the size would do the trick?
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<Button
android:id="@+id/Button1"
android.layout_height="100px"
android.layout_width="60px"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="BUTTON1"/>
You should use
instead of
in button attributes.
Button width can be changed by android:padding attribute in LinearLayout
Example: