'Remove extra space on button and remove rounded corner in Android Studio
I'm trying to make 4 buttons in a grid layout, but I don't know how to remove the extra space on top and bottom on each button. I also don't know how to remove the rounded corner. I tried to use cornerRadius but it does nothing.
Here's the screenshot of the layout.As you can see, there's a gap in the middle of top and bottom buttons.
Here's the xml code:
<androidx.gridlayout.widget.GridLayout
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="8dp"
android:layout_marginTop="100dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="256dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<Button
android:id="@+id/answerBtn1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="0dp"
android:backgroundTint="#9C27B0"
android:onClick="chooseAnswer"
android:tag="0"
android:text="120"
android:textSize="50dp"
app:layout_column="0"
app:layout_columnWeight="1"
app:layout_gravity="fill"
app:layout_row="0"
app:layout_rowWeight="1" />
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

