iphone - 绘制末端渐变的 UIBezierPath(渐变)

标签 iphone ios ipad drawing uibezierpath

我正在尝试绘制一个在两端淡出的 UIBezierPath - 从 alpha 01 然后回到 0 。我基本上希望能够从 drawRect在 UIBezierPath 中绘制渐变。

编辑:这是我想要达到的效果:

enter image description here

最佳答案

使用 -strokeWithBlendMode:alpha: 怎么样?

与某种不断增加/减少 alpha 值直到达到 1 的循环相结合(并且增量决定了“褪色”段的长度)应该有效。

参见 here

关于iphone - 绘制末端渐变的 UIBezierPath(渐变),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14667014/

相关文章:

iphone - 在 ipad 和 iphones 中隐藏 iframe 的一部分

ios - 使用 AutoLayout 的 UitableView 中的动态单元格高度问题?

ios - 在浏览器的视口(viewport)中有选择地切换 <DIV>

iphone - 隐藏快门动画 UIImagePickerController

ios - 关闭纵向 View Controller 时应用程序崩溃

ios - 在 iOS 中实现捏合缩放(如 UIWebView 中所示)

iphone - iOS 设备上的核心日期获取请求

ios - 啊!试图重置核心数据。每隔两次工作?

iphone - Inmobi方向iphone,

iphone - iOS 7 更新对我的应用的影响