【问题标题】:UIStringDrawing Change font color - cocoa touchUIStringDrawing 更改字体颜色 - 可可触摸
【发布时间】:2009-06-20 11:19:31
【问题描述】:

UIFont 似乎无法管理颜色,有没有办法使用 UIStringDrawing.h 或具体更改字体颜色:

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

谢谢

【问题讨论】:

    标签: iphone cocoa-touch


    【解决方案1】:

    看看UIColor。具体来说:

    - (void) setFill;
    

    例如:

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

    其他方法包括setStrokeset 来设置填充和描边。字体使用填充颜色。

    【讨论】:

      猜你喜欢
      • 2015-04-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-05-28
      • 2018-01-08
      • 1970-01-01
      • 1970-01-01
      • 2021-06-19
      相关资源
      最近更新 更多