CGContext 的一些工具方法

/*
 *设置虚线
 *param context CGContext
 *param context CGContext
 *param lineDashLengths  如:  const CGFloat lineDashLengths[2] = {2., 50. }; 2 是没接虚线的长度2 和间隔50
 *returns
 */

void setXuXian(CGContextRef context,const CGFloat lineDashLengths[],CGFloat width){
    CGContextSetLineWidth(context, width);
    CGContextSetLineDash(context, 0., lineDashLengths, 2);
}

  

原文地址:https://www.cnblogs.com/zander/p/3433941.html