Ja, Sie können umrissenen Text mit Hilfe von CGContextSetDrawingMode(CGContextRef, CGTextDrawingMode)
anzeigen, obwohl Sie wahrscheinlich einige Zahlen und Farben anpassen müssen, damit es gut aussieht.
Es scheint logisch zu sein, kCGTextFillStroke zu verwenden, aber das kann dazu führen, dass der Strich die Füllung überwältigt. Wenn Sie streichen, dann füllen Sie, wie in dem Block unten, erhalten Sie einen sichtbaren Umriss hinter lesbarem Text.
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];
Vielen Dank ... es hat super funktioniert !! – user836026
funktioniert nicht in meinem Fall, ich folgte den gleichen Schritten –