karthik selvaraj
karthik selvaraj

Reputation: 499

Expandable Height GridView inside scrollview

i am using Expandableheightgrideview inside Scroll view,

my problem is when i try to add content in gridview, the content is not expand properly, its displaying 2 scroll bar when its height is exist(its suppose to be an one common scroll bar for entire page).Bottom of the content is hide to view bottom content in gride view need to scroll down.

i used exGridView.setExpanded(true); but no luck

    <?xml version="1.0" encoding="utf-8"?>
<ScrollView 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_marginTop="25dp"
    android:background="@color/transparent"
    android:fillViewport="true" >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical" >

        <com.ExpandableHeightGridView
            android:id="@+id/result_list"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:horizontalSpacing="2dp"
            android:isScrollContainer="false"
            android:numColumns="1"
            android:stretchMode="columnWidth"
            android:verticalSpacing="2dp" >
        </com.ExpandableHeightGridView>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal" >

            <LinearLayout
                android:id="@+id/start_task_layout"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"

                android:layout_gravity="right">

                <Button
                    android:id="@+id/homeBtn"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginRight="0dip"
                    android:text="Home"
                    android:textSize="12dip" />
            </LinearLayout>

        </LinearLayout>
    </LinearLayout>

</ScrollView>

Upvotes: 4

Views: 14599

Answers (1)

Igor Ronner
Igor Ronner

Reputation: 1584

The Answer is here Problems with GridView inside ScrollView in android

I used ExpandableHeightGridView.java of gitHub and works https://gist.github.com/sakurabird/6868765

Upvotes: 2

Related Questions