我在 iOS7 上遇到了文本描边的问题,虽然在 iOS4、iOS5 和 iOS6 上都能正常工作。自从我将设备升级至 iOS7 以后,我就看不到描边颜色了。有人知道为什么吗?
以下是我的代码:
UIGraphicsBeginImageContext(CGSizeMake(scale(line.position.width), scale(line.position.height)));
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetLineWidth (context, scale(4.0)); //4.0
CGContextSetLineJoin(context, kCGLineJoinRound);
CGContextSetBlendMode(context, kCGBlendModeScreen);
CGContextSetTextDrawingMode(context, kCGTextFillStroke);
CGContextSetRGBFillColor(context, 1.0, 1.0, 1.0, 1.0);
CGContextSetRGBStrokeColor(context, 0.0, 0.0, 0.0, 1.0);
[label.text drawInRect:label.frame withFont:label.font];
self.image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();