How to make listview and GridLayout scrollable

This is my layout file. My gridlayout is fixed, only my list scrolls. I tried setting gridlayout as the listview header, but then there are two gridlayouts.please, let me know what I'm doing wrong. I want the whole layout to scroll, including the listview below it.

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:layout_gravity="center_vertical"
  android:gravity="center_vertical"  >



  <LinearLayout
    android:id="@+id/layoutid"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_centerHorizontal="true"
    android:orientation="vertical">

 <GridLayout
    android:layout_width="wrap_content"
    android:layout_height="fill_parent"
    android:columnCount="8"
    android:rowCount="7"     
    android:layout_gravity="center_horizontal" >

    <TextView
        android:id="@+id/terminaterf"
        android:layout_width="80dip"
        android:layout_height="70dip"
        android:layout_columnSpan="2"
        android:layout_rowSpan="1"
        android:background="#FF4981"
        android:textColor="#FFFFFF"
        android:gravity="center"
        android:clickable="true"
        android:textSize="13sp" />
     </GridLayout      >

     <include 
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      layout="@layout/my_listview"
      android:layout_gravity="center_vertical"/>
 </LinearLayout>
</RelativeLayout>
+4
source share
1 answer
  Adding gridlayout to header of listview resolved my issue
+4
source

Source: https://habr.com/ru/post/1541872/


All Articles