When I add the 5th column, the button with the number 5 half crawls out of the screen. When I add value to the buttons: android:layout_columnWeight="1", then the button with number 1 is stretched out of the screen.
How can I fit all 5 columns on the screen?
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
<GridLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:rowCount="5"
android:columnCount="5">
<Button
android:layout_width="wrap_content"
android:layout_height="100dp"
android:text="1"
android:textSize="25dp"
android:textColor="@color/white"
android:background="@color/black"
android:layout_row="0"
android:layout_column="0"/>
<Button
android:layout_width="wrap_content"
android:layout_height="100dp"
android:text="2"
android:textSize="25dp"
android:textColor="@color/white"
android:background="@color/black"
android:layout_row="0"
android:layout_column="1"/>
<Button
android:layout_width="wrap_content"
android:layout_height="100dp"
android:text="3"
android:textSize="25dp"
android:textColor="@color/white"
android:background="@color/black"
android:layout_row="0"
android:layout_column="2"/>
<Button
android:layout_width="wrap_content"
android:layout_height="100dp"
android:text="4"
android:textSize="25dp"
android:textColor="@color/white"
android:background="@color/black"
android:layout_row="0"
android:layout_column="3"/>
<Button
android:layout_width="wrap_content"
android:layout_height="100dp"
android:text="5"
android:textSize="25dp"
android:textColor="@color/white"
android:background="@color/black"
android:layout_row="0"
android:layout_column="4"/>
</GridLayout>
</RelativeLayout>