ListView不会停在手指上吗?

时间:2012-02-29 12:25:19

标签: android scroll android-listview

我有一个listView,在xml中定义如下:

<ListView
        android:id="@android:id/list"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginTop="150dp"
        android:layout_x="4dp"
        android:layout_y="183dp"
        android:cacheColorHint="#00000000"
        android:fadingEdge="vertical"
        android:enabled="true" >
    </ListView>

一切都很好,但是如果用户想要向下滚动列表以查看其他项目并获得他的手指列表,则会以一种奇怪的方式返回顶部?它只是没有停止用户滚动的位置......为什么会发生这种情况? 提前感谢您的帮助...

3 个答案:

答案 0 :(得分:0)

试试这个:

<ListView
        android:id="@android:id/list"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginTop="150dp"        
        android:cacheColorHint="#00000000"
        android:fadingEdge="vertical"
        android:enabled="true" >
</ListView>

答案 1 :(得分:0)

这条线以某种方式解决了我的问题:

android:layout_marginBottom = "60dp" 

答案 2 :(得分:-1)

也许你不应该将match_parent用于身高。