You need one root layout
to contain your GridView
and the layout
that you want below the GridLayout
. If GridlLayout
is the root layout
then there can't be anything below it. It can be LinearLayout
, RelativeLayout
, etc... But something needs to contain the GridLayout
and the layout
/View
below the GridLayout
. Ex
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/chessBoard"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:columnCount="8"
tools:context=".GridLayoutActivity" >
<ImageButton
android:id="@+id/cell00"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_column="0"
android:layout_row="0"
android:scaleType="fitXY"
android:src="@drawable/black_castle"
android:background="@color/chessTan"
android:contentDescription="00" />
<ImageButton
android:id="@+id/cell01"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_column="1"
android:layout_row="0"
android:scaleType="fitXY"
android:src="@drawable/black_knight"
android:background="@color/chessBrown"
android:contentDescription="01" />
...
</GridLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="chessBoard" // will place it below the GridLayout
>
//some views inside LinearLayout
</LinearLayout>
</RelativeLayout>