0

I have a custom GridView inside a ScrollView. I used this example :

Gridview height gets cut

It works fine now !

But what I want, is to make ONLY the GridView scrolling and disable the scroll of the parent ScrollView. I tried with this example :

ListView inside ScrollView is not scrolling on Android

But it's not working at all.

How can I do that please ?

Community
  • 1
  • 1

2 Answers2

0

1) Create a RelativeLayout called griditem

2) Develop a your self ListAdapter

3) Grid layout:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <GridView
        android:id="@+id/grid"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:numColumns="3" >
    </GridView>

</LinearLayout>

4) Fill the adapter with a GridView

        gv = (GridView) findViewById(R.id.grid);
        adapter = new ListAdapter(this, R.layout.griditem, R.id.title,
                contentList);
        gv.setAdapter(adapter);
Alfaplus
  • 1,713
  • 2
  • 19
  • 29
0

You can take a look at how to put a listview inside a scroll view here. It shows how to do it using a listview, worth a look.. :)

Community
  • 1
  • 1
George Thomas
  • 4,566
  • 5
  • 30
  • 65