我在滚动视图中使用 Expandableheightgrideview,
我的问题是,当我尝试在 gridview 中添加内容时,内容未正确展开,当其高度存在时,它会显示 2 个滚动条(它应该是整个页面的一个通用滚动条)。内容的底部是隐藏的要在网格视图中查看底部内容需要向下滚动。
i used exGridView.setExpanded(true);
但没有运气
<?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>
答案就在这里android中ScrollView中GridView的问题
我使用了 gitHub 的 ExpandableHeightGridView.java 并且有效https://gist.github.com/sakurabird/6868765
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)