Android Scrollview无限滚动

时间:2014-12-02 15:27:43

标签: android layout scroll scrollview relativelayout

我的Android ScrollView存在问题。我正面临着无限的垂直滚动。即使我已经耗尽了元素,我也可以继续滚动白色空间。我希望ScrollView向下滚动到相对布局的末尾。如果您有任何解决方案,我们将不胜感激。

提前致谢

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
     android:id="@+id/scroll1"

     >


<RelativeLayout  

    android:layout_width="fill_parent"
    android:layout_height="match_parent"

    android:id="@+id/info"
    android:background="@color/main_backgroundColor" >



      <LinearLayout 
        android:id="@+id/Line"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical">
        </LinearLayout>

         <com.etsy.android.grid.StaggeredGridView
        android:id="@+id/mainGridview"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:numColumns="2"
        android:scrollbars="none"
        android:stretchMode="columnWidth"
           android:layout_below="@+id/Line"
        android:verticalSpacing="1dp" />




        <WebView
        android:id="@+id/WebView_home"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:visibility="invisible" />



</RelativeLayout>
</ScrollView>

1 个答案:

答案 0 :(得分:0)

当然我不知道你的项目的结构,但为什么你不使用ListView和CWAC MergeAdapter?它可以帮助你无限滚动。

这是一个链接:https://github.com/commonsguy/cwac-merge

相关问题