0

I put a textview inside the header of a gridview but if I need to scroll the textview it not scroll, instead scroll the gridview.

This is the code:

<GridWithHeader
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:id="@+id/gridWithHeader"
    android:numColumns="2"
    android:focusableInTouchMode="true"
    android:nestedScrollingEnabled="true"
    android:focusable="true" />

And this is the content of header

<LinearLayout
        android:orientation="horizontal"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_gravity="center_horizontal"
        android:layout_weight="1"
        android:id="@+id/row_2"
        android:weightSum="1">

        <TextView
            android:id="@+id/text_header_view"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />
    </LinearLayout>

where is the error or how can I solve the problem?

francesco.venica
  • 1,703
  • 2
  • 19
  • 54

1 Answers1

0

try to delete from "GridWithHeader" android:focusableInTouchMode and android:focusable="true" and add them to you Textview like this:

          <TextView              
          android:id="@+id/text_header_view"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:focusable="true"
          android:focusableInTouchMode="true"
          android:fadeScrollbars="false"
          android:scrollbars="vertical" >
Mounir Elfassi
  • 2,242
  • 3
  • 23
  • 38