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.
CGPathRef 定义了一个表示不可变图形路径的不透明类型。CGMutablePathRef 定义了一个表示可变图形路径的不透明类型。
但是我们如何改变 in 的不透明度CGPath呢CoreGraphics?可以按百分比加吗?
CGPath
CoreGraphics
它在 UIKit 和 Core Graphics 中被称为“alpha”。例如:
UIColor *color = [[UIColor alloc] initWithWhite:0.5f alpha:0.5f]; CGContextSetStrokeColor(context, color.CGColor); // Assuming you have a context. CGContextStrokePath(context);