Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 UILabel 中显示 unicode 字符,如下所示:
NSString *str = @"flag \u2691 and heart \u2764"; myUILabel.text = str;
旗帜以黑白显示,而心形则以渐变的红色显示。那么问题来了:是否可以控制 unicode 字符的颜色?
看看OHAttributedLabel。它允许您为文本标签设置超过 1 种颜色的样式。(还可以让您在一个标签中使用不同的字体)