使滚动视图褪色的边缘,机器人滚动时 [英] making the edge of the scrollview fade when scrolling in android

查看:115
本文介绍了使滚动视图褪色的边缘,机器人滚动时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个滚动型在它的图像。

我要的边缘滚动型制作淡入淡出效果,当我滚动图像。 我不是在谈论当你到滚动结束时,您得到的效果。我想淡出始终存在。

I want the edges of the ScrollView to make a fade effect when I scroll the image. I'm not talking about the effect you get when you get to the end of the scroll. I want the fade to always exist.

这就是我所做的(没有做任何效果):

That's what i did (not doing any effect):

<ScrollView
    android:id="@+id/scrollView1"
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_weight="0.84"
    android:background="@drawable/screen_nespresso"
    android:fadingEdge="horizontal"
    android:fadingEdgeLength="@dimen/padding_large"
    android:fillViewport="false"
    android:scrollbarAlwaysDrawVerticalTrack="true"
    android:visibility="visible" >

谢谢!

推荐答案

我不知道,如果你这个工作,但这里是为我工作:

I am not sure if you this working, but here is what worked for me:

<ScrollView android:requiresFadingEdge="vertical">

和在code,你可以做以下

and in your code, you can do the following

ScrollView scroll = findById(); scroll.setFadingEdgeLength(150);

这篇关于使滚动视图褪色的边缘,机器人滚动时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆