UIFont似乎没有管理颜色,有没有办法使用UIStringDrawing.h或具体来改变字体颜色:
- (CGSize)drawInRect:(CGRect)rect withFont:(UIFont *)font
由于
答案 0 :(得分:10)
看看UIColor
。具体做法是:
- (void) setFill;
例如:
[[UIColor redColor] setFill];
[myString drawInRect:rect withFont:font];
其他方法包括setStroke
和set
来设置填充和描边。字体使用填充颜色。