简体   繁体   中英

iOS — is there anything like CGContextSetLineDash for paths?

I want to draw a path, but with a dotted line rather than a solid one. Using lines would be possible, but it would be a pain.

The "line" in CGContextSetLineCap, CGContextSetLineDash, CGContextSetLineJoin, and CGContextSetLineWidth refers to the "line" of color that is drawn along the path when stroking it, as opposed to the solid area inside that is colored when filling. This is not to be confused with the "line" in CGContextAddLines, CGContextAddLineToPoint, CGPathAddLines, and CGPathAddLineToPoint, which refers to the geometrical line segment that may be part of a path.

To use an analogy, when you're drawing by hand on paper you move your pen along a path which leaves a line on the paper.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM