首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Android ScrollView overscroll指示灯问题

Android ScrollView overscroll指示灯问题
EN

Stack Overflow用户
提问于 2013-01-11 22:01:25
回答 1查看 1.7K关注 0票数 0

这是一个奇怪的问题,我的三星GT-I9003L。我有一个包含LinearLayout的ScrollView,里面有不同的东西(ImageView、按钮、EditText等)。当在2.3.3和4.2版本的仿真器中测试时,它可以完美地工作。

代码语言:javascript
复制
<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指示灯(蓝色/橙色发光)根本不显示。我设法让他们使用这一行:

代码语言:javascript
复制
ScrollView addNewScroll = (ScrollView)findViewById(R.id.scroll_view);
addNewScroll.setOverScrollMode(ScrollView.OVER_SCROLL_IF_CONTENT_SCROLLS);

但当我到达顶端或结尾时,光芒只是“出现”,它不是动画,也不是淡入。

提前感谢您的帮助!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-02-12 17:48:57

我们遇到了完全相同的问题。Overscolling似乎不适用于三星Galaxy 2 (Touchwiz),但也适用于HTC One X手机(老款HTC似乎还行)。

怀疑他们用自己的实现替换了ScrollView实现,可能是为了弹性滚动条或其他什么。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14279713

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档