首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >HorizontalScrollView fadingEdge

HorizontalScrollView fadingEdge
EN

Stack Overflow用户
提问于 2013-10-30 08:05:27
回答 2查看 1.8K关注 0票数 1

我试图为简单的HorizontalScrollView添加褪色的边。关于fadingEdge属性的文档:

这个属性被弃用,并将在APILevel14 (ICE_CREAM_SANDWICH)时被忽略。使用褪色的边缘可能会带来明显的性能下降,只有在应用程序的视觉设计需要时才能使用。若要请求API级别14及以上的渐变边缘,请使用android:requiresFadingEdge属性。

好的,但是这个布局也没有显示任何褪色的边缘:

代码语言:javascript
复制
<HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/horizontalScrollView1"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:requiresFadingEdge="horizontal"
    android:fadingEdgeLength="50dp"
    tools:context=".MainActivity" >

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:orientation="horizontal" >

        <TextView
            android:id="@+id/textView1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="TextView" />

        ...

    </LinearLayout>

</HorizontalScrollView>

我遗漏了什么?

EN

回答 2

Stack Overflow用户

发布于 2014-07-19 04:36:28

尝试使用android:overScrollMode属性。

只需加上

代码语言:javascript
复制
android:overScrollMode="always"

敬你的HorizontalScrollView

android:overScrollMode可以有三个值:“总是”、“从不”、"ifContentScrolls“。

票数 0
EN

Stack Overflow用户

发布于 2021-01-28 07:30:05

只管用

代码语言:javascript
复制
android:requiresFadingEdge="horizontal|vertical" 
android:fadingEdgeLength="10dp"
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19676845

复制
相关文章

相似问题

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