I have images in a Grid Layout. However the Grid Layout rows overflow the screen. I think the image widths are not the cause of problem. If I delete the images, the grid layout lines still overflow.
How can I solve this?
Code:
<?xml version="1.0" encoding="utf-8"?>
<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/myGridLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:columnCount="2"
android:rowCount="2"
tools:context="com.example.orhan9.mdtransitionanimation.MainActivity">
<ImageView
android:id="@+id/papagan"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="0"
android:layout_row="0"
app:srcCompat="@drawable/papagan"
/>
<ImageView
android:id="@+id/goril"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_row="0"
app:srcCompat="@drawable/goril" />
<ImageView
android:id="@+id/okuz"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="0"
android:layout_row="1"
app:srcCompat="@drawable/okuz" />
<ImageView
android:id="@+id/ordek"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_row="1"
app:srcCompat="@drawable/ordek" />
<Button
android:id="@+id/btnTransition"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="transition animation" />
</GridLayout>
Layout screen: