Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试绘制一个UIBezierPath在两端淡出的 - 从 alpha0到1然后回到0. 我基本上希望能够从内部在 UIBezierPath 中绘制渐变drawRect。
UIBezierPath
0
1
drawRect
编辑:这是我想要达到的效果:
怎么用-strokeWithBlendMode:alpha:?
-strokeWithBlendMode:alpha:
结合某种不断增加/减少 alpha 值直到达到 1 的循环(并且增量确定“褪色”段的长度)应该可以工作。
看这里