这是一个奇怪的问题,我的三星GT-I9003L。我有一个包含LinearLayout的ScrollView,里面有不同的东西(ImageView、按钮、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>问题是,当我在我的手机上测试它时,overscroll指示灯(蓝色/橙色发光)根本不显示。我设法让他们使用这一行:
ScrollView addNewScroll = (ScrollView)findViewById(R.id.scroll_view);
addNewScroll.setOverScrollMode(ScrollView.OVER_SCROLL_IF_CONTENT_SCROLLS);但当我到达顶端或结尾时,光芒只是“出现”,它不是动画,也不是淡入。
提前感谢您的帮助!
发布于 2013-02-12 17:48:57
我们遇到了完全相同的问题。Overscolling似乎不适用于三星Galaxy 2 (Touchwiz),但也适用于HTC One X手机(老款HTC似乎还行)。
怀疑他们用自己的实现替换了ScrollView实现,可能是为了弹性滚动条或其他什么。
https://stackoverflow.com/questions/14279713
复制相似问题