あなたはおそらくそれが良い見えるようにいくつかの数字や色を調整する必要がありますが、はい、あなたは、CGContextSetDrawingMode(CGContextRef, CGTextDrawingMode)
の助けを借りて概説テキストを表示することができます。それが作る
はkCGTextFillStrokeを使用して論理的に見えるが、それはストロークが塗りつぶしを圧倒することができます。ストロークした場合は、下のブロックのように塗りつぶして、読みやすいテキストの目に見えるアウトラインを取得します。
CGContextRef context = UIGraphicsGetCurrentContext();
CGPoint point = CGPointMake(0,30);
CGFloat fontSize = (3 * MKRoadWidthAtZoomScale(zoomScale));
UIFont *font = [UIFont fontWithName:@"Helvetica-Bold" size:fontSize];
// Draw outlined text.
CGContextSetTextDrawingMode(context, kCGTextStroke);
// Make the thickness of the outline a function of the font size in use.
CGContextSetLineWidth(context, fontSize/18);
CGContextSetStrokeColorWithColor(context, [[UIColor redColor] CGColor]);
[text drawAtPoint:point withFont:font];
// Draw filled text. This will make sure it's clearly readable, while leaving some outline behind it.
CGContextSetTextDrawingMode(context, kCGTextFill);
CGContextSetFillColorWithColor(context, [[UIColor blueColor] CGColor]);
[text drawAtPoint:point withFont:font];
多くのありがとう...それは素晴らしい! – user836026
私の場合は動作しません私は同じ手順に従った –