Android ScrollView过度滚动指示器问题

时间:2013-01-11 14:01:25

标签: java android xml scrollview overscroll

这与我的三星GT-I9003L有一个奇怪的问题。我有一个包含LinearLayout的ScrollView,里面有不同的东西(ImageView,Button,EditText等),它在2.3.3和4.2版本的模拟器中测试时效果很好。

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/scroll_view"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" >

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:padding="16dp" >

        <ImageView
            android:id="@+id/image"
            android:layout_width="fill_parent"
            android:layout_height="200dp"
            android:contentDescription="@string/img_description"
            android:src="@drawable/ic_launcher" />

        <Button
            android:id="@+id/btn_camera"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="@string/add_new_btn_camera" />

        <Button
            android:id="@+id/btn_gallery"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="@string/add_new_btn_gallery" />

        <EditText
            android:id="@+id/name"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:ems="10"
            android:hint="@string/add_new_name_hint"
            android:inputType="text"
            android:maxLength="80" />

        [...]
    </LinearLayout>

</ScrollView>

问题是,当我在手机上测试时,过度滚动指示灯(蓝色/橙色发光)根本不显示。我设法让他们使用这一行:

ScrollView addNewScroll = (ScrollView)findViewById(R.id.scroll_view);
addNewScroll.setOverScrollMode(ScrollView.OVER_SCROLL_IF_CONTENT_SCROLLS);

但是当我到达顶部或末端时,发光只是“出现”,它不会动画或淡入。

提前感谢您的帮助!

1 个答案:

答案 0 :(得分:0)

我们遇到了完全相同的问题。过度使用似乎不适用于三星Galaxy 2(Touchwiz),也适用于HTC One X手机(较旧的HTC似乎有效)。

怀疑他们用自己的ScrollView实现替换了ScrollView实现,可能是用于弹性滚动条等。

相关问题