Drawing colored text in UIView's -drawRect: method

后端 未结 2 1054
天涯浪人
天涯浪人 2021-02-06 23:42

I am trying to draw colored text in my UIView subclass. Right now I am using the Single View app template (for testing). There are no modifications except the

2条回答
  •  情歌与酒
    2021-02-07 00:20

    Instead of UITextAttributeTextColor you should use NSForegroundColorAttributeName. Hope this helps!

提交回复
热议问题