objective-c - iOS凤凰新闻这种控件跟随滑动的效果是怎么做出来的?
巴扎黑
巴扎黑 2017-04-17 17:51:33
0
3
552

文字颜色渐变我已经做出来了,在- (void)scrollViewDidScroll:(UIScrollView *)scrollView中通过偏移量计算出两个scale,一个递增一个递减,从0~1和从1~0,通过这个scale来动态修改RGB颜色。

这个下划线,在我滚动下面的新闻表格的时候,它会动态的改变frame,偏移的x和宽度。
目前我只是在- (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView中,在拖动完成后,加了个动画。

我想做出凤凰新闻这样的效果,下划线可以实时跟随改变,不知各位能提供一下思路吗?折腾好久了T_T

巴扎黑
巴扎黑

reply all(3)
黄舟

A demo I wrote to simulate Phoenix News after reading your question this afternoon.
Article: Simulating Phoenix News | More complex label animation - Swift implements side sliding and switching of multiple TableViews
Project source code: github repository: Simulating Phoenix News homepage

大家讲道理

You can use pop, or implement it yourself

阿神

Okay, I solved it myself.
It’s actually a math problem. . .

The specific demo is on github. If you need it, you can take a look at it in the DDNewsViewController.m文件的scrollViewDidScrollmethod.
https://github.com/iDvel/DDNews

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template