Gridlayout widget out of screen Android

298 views Asked by At

The GridView I made results in the following layout:

Grid Layout with ImageButton out of Screen

How to set up the layout to avoid the out of screen widgets?

The Grid Layout itself is ok and filling the screen but the children do not and overlapp.

here the XML of the gridlayout:

 <GridLayout
    android:layout_width="fill_parent"
    android:layout_height="match_parent"
    android:columnCount="4"
    android:rowCount="3">

    <ImageButton
        android:id="@+id/imageView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/circular"
        android:layout_row="0"
        android:layout_column="3"
        android:layout_rowSpan="3" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="New Text"
        android:id="@+id/textView4"
        android:layout_row="1"
        android:layout_column="0" />

    <EditText
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:inputType="numberDecimal"
        android:ems="10"
        android:id="@+id/editText"
        android:layout_row="1"
        android:layout_column="1" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="New Text"
        android:id="@+id/textView5"
        android:layout_row="1"
        android:layout_column="2" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="New Text"
        android:id="@+id/textView10"
        android:layout_row="2"
        android:layout_column="0" />

    <EditText
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:inputType="numberDecimal"
        android:ems="10"
        android:id="@+id/editText2"
        android:layout_row="2"
        android:layout_column="1" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="New Text"
        android:id="@+id/textView11"
        android:layout_row="2"
        android:layout_column="2" />
</GridLayout>
0

There are 0 answers