简体   繁体   中英

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>

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM