How can I make my buttons big

I am trying to increase the height of the buttons. I am trying to inflate a string, but it does not work.

check out my updated code with relative location and table ...

tried to increase the row and the result of the table ... Result:

I tried XML

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/black_bg" android:layout_centerVertical="true"> <TableLayout android:id="@+id/row1" android:layout_width="fill_parent" android:layout_height="45dip" android:paddingRight="5px" android:paddingLeft="5px" android:paddingTop="15px" android:paddingBottom="5px" android:layout_weight="1"> <TableRow android:layout_weight="1" android:layout_height="50dip"> <ToggleButton android:id="@+id/btn_service_plus" android:layout_marginRight="4px" android:textColor="@android:color/white" android:textStyle="bold" android:textSize="12dip" android:layout_width="0dp" android:layout_height="fill_parent" android:text="1" android:layout_weight="1" /> <Button android:layout_marginLeft="4px" android:layout_marginRight="4px" android:textColor="@android:color/white" android:textStyle="bold" android:layout_width="0dp" android:layout_height="fill_parent" android:textSize="12dp" android:layout_weight="1" /> <Button android:layout_marginLeft="4px" android:layout_marginRight="4px" android:textColor="@android:color/white" android:textStyle="bold" android:layout_width="0dp" android:layout_height="fill_parent" android:textSize="12dp" android:layout_weight="1" /> <ToggleButton android:layout_marginLeft="4px" android:textColor="@android:color/white" android:textStyle="bold" android:layout_width="0dp" android:layout_height="fill_parent" android:textSize="12dp" android:layout_weight="1" android:background="@drawable/menu_button_layout"/> </TableRow> 
+6
source share
2 answers

The edited code now checks this.

  <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/black_bg" android:layout_centerVertical="true"> <TableLayout android:id="@+id/row1" android:layout_width="fill_parent" android:layout_height="100dip" android:paddingRight="5px" android:paddingLeft="5px" android:paddingTop="15px" android:paddingBottom="5px" > <TableRow android:layout_weight="1" android:layout_height="50dip"> <ToggleButton android:id="@+id/btn_service_plus" android:layout_marginRight="4px" android:textColor="@android:color/white" android:textStyle="bold" android:textSize="12dip" android:layout_width="0dp" android:layout_height="fill_parent" android:text="1" android:layout_weight="1" /> <Button android:layout_marginLeft="4px" android:layout_marginRight="4px" android:textColor="@android:color/white" android:textStyle="bold" android:layout_width="0dp" android:layout_height="fill_parent" android:textSize="12dp" android:layout_weight="1" /> <Button android:layout_marginLeft="4px" android:layout_marginRight="4px" android:textColor="@android:color/white" android:textStyle="bold" android:layout_width="0dp" android:layout_height="fill_parent" android:textSize="12dp" android:layout_weight="1" /> <ToggleButton android:layout_marginLeft="4px" android:textColor="@android:color/white" android:textStyle="bold" android:layout_width="0dp" android:layout_height="fill_parent" android:textSize="12dp" android:layout_weight="1" android:background="@drawable/menu_button_layout"/> </TableRow> 
0
source

I may be a little late to the party, but I think CJBS (see comment on Akram) is right. Unfortunately, I cannot make a comment, so I will post this as an answer (which should also be good, because I give an answer).

Since the OP answer already answered, I will give an answer that will help people with the same question:

This will make the button text larger:

 android:textSize="" 

This will increase the height of the button:

 android:height="" 

This will make the button wider:

 android:width="" 

EDIT:

Using 'min' to 'width' or 'height' might also be a good idea.

Example:

 android:minWidth="" 
+4
source

Source: https://habr.com/ru/post/908823/


All Articles