IOS 5.1 UILabel with Heavy Check Mark character ignores TextColor

限于喜欢 提交于 2019-12-05 22:00:17

Update and fix that works for me, but still very strange. If anyone else ran into this obscure issue I found that using a named font instead of system font seems to fix it.

In iOS9 they have removed the possibility to colour the heavy checkmark also for non-standard fonts. This is because the U+2714 HEAVY CHECK MARK is included in Apple's set of emoji characters and it will be drawn as a full-colour bitmap instead of a single-colour unicode character.

The way to prevent this from happening, you could use a U+FE0E VARIATION SELECTOR-15 character. If you change the string to @"\u2714\uFE0E" you would be able to colour it.

isChecked.text = @"\u2714\uFE0E";
isChecked.textColor = [UIColor redColor];
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!