UIStringDrawing Change Font Color - cocoa touch

UIFont does not control color, is there any way to change the font color using UIStringDrawing.h or in particular:

- (CGSize)drawInRect:(CGRect)rect withFont:(UIFont *)font

thanks

+3
source share
1 answer

Take a look at UIColor. In particular:

- (void) setFill;

For example:

[[UIColor redColor] setFill];
[myString drawInRect:rect withFont:font];

Other methods include setStrokeand just setto set both fill and stroke. Fonts use fill color.

+10
source

Source: https://habr.com/ru/post/1710904/


All Articles