I am implementing an android application and I want to display something like the following picture, with an imageview and textview inside each square of the gridview but I am not able to have all the items fitting the whole screen. I have a limited nummber of items to show and I just want to put them fitting all the screen for any screen size without calculating dimensions and this. Can you help me?? Thanks.
main.xml:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.rafad.betasentit.MainActivity">
<GridView
android:id="@+id/appsGridView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorAccent"
android:numColumns="2">
</GridView>
</FrameLayout>
item.xml:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_height="match_parent"
android:padding="10dp">
<TextView
android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_weight="1"
android:padding="5dp"
android:background="@color/colorPrimary"/>
<ImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="match_parent" />