3

The problem was that I had a setEnabled in my code. Sorry. I already fix this

I want that my gridview with height = 70dp is scrollable vertically.

<GridView
    android:id="@+id/list_label"
    android:layout_width="match_parent"
    android:layout_height="70dp"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true"
    android:layout_alignParentTop="true"
    android:numColumns="2"
    />

Anybody can help me with this?

rafaelasguerra
  • 2,685
  • 5
  • 24
  • 56

5 Answers5

5
<GridView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/gridView1"
android:numColumns="2"
android:gravity="center"
android:columnWidth="70dp"
android:stretchMode="columnWidth"
android:layout_width="fill_parent"
android:scrollbars="horizontal"
android:layout_height="fill_parent" >
</GridView>
Faraz Baig
  • 66
  • 2
2

Try to use:

android:scrollbars="vertical"

For vertical scrollbar

Shailendra Madda
  • 20,649
  • 15
  • 100
  • 138
1
gridView = (GridView)findViewById(R.id.rvProduit1); 
ViewCompat.setNestedScrollingEnabled(gridView,true);
Zoe
  • 27,060
  • 21
  • 118
  • 148
0

Add

 android:scrollbars="horizontal"
Arjun
  • 34
  • 1
  • 8
0

This will work. Use this on .java file.

gridView = (GridView)findViewById(R.id.list_label); 
ViewCompat.setNestedScrollingEnabled(gridView,true);