1

I'm trying to create a Tria games in android. I have created a grid layout with 3 rows and 3 columns. Inside the cells there 9 square imageViews. I want occupy all the space of the grid layout, and the images must have the same dimensions. How can I do this?

There is the layout

<GridLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:columnCount="3"
            android:rowCount="3">

and this is a sample of an imageView

<ImageView
                android:id="@+id/imageView9"
                android:layout_width="48dip"
                android:layout_height="48dip"
                app:srcCompat="@drawable/android" />

(48dip is for an experiment)

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Rik99
  • 79
  • 8

1 Answers1

1

Instead of giving fixed width and hight give in term of Weight

 android:layout_weight="1"
RANVIR GORAI
  • 1,226
  • 11
  • 10