UIScrollView,通过淡出文本显示更多数据 [英] UIScrollView, showing that there is more data by fading out text
本文介绍了UIScrollView,通过淡出文本显示更多数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当UIScrollView中有更多数据要滚动浏览时,是否有一种方法可以使顶部和底部的文本淡入淡出?为了获得这种效果,我是否必须在UIScrollView的UILabel上放置一些内容?
Is there a way to fade text at the bottom and top when there is more data to be scrolled through in the UIScrollView? Would I have to put something on top of the UILabel I have in the UIScrollView in order to get that effect?
推荐答案
You can use a CAGradientLayer
on both top and bottom. You can add/remove this in the delegate method scrollViewDidScroll:
based on the scroll view's contentOffset
.
这篇关于UIScrollView,通过淡出文本显示更多数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文