UILabel,UIFont和UTF-8三角形 [英] UILabel, UIFont and UTF-8 Triangle

查看:335
本文介绍了UILabel,UIFont和UTF-8三角形的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用BLACK RIGHT-POINTING TRIANGLE(U + 25B6)作为我的 UILabel 的文本的一部分。标签使用系统字体( UIFont systemFontOfSize:)。问题是,我的三角形被渲染为一个花哨的图像,而不是一个黑色右指向三角形。


I'd like to use "BLACK RIGHT-POINTING TRIANGLE" (U+25B6) as a part of my UILabel's text. The label uses the system font (UIFont's systemFontOfSize:). The problem is that my triangle is rendered as a fancy image, not a "black right-pointing triangle". Is it possible to see the plain version?

推荐答案

基于:

在iOS5中以不同方式绘制的Unicode字符

iOS 6支持 Unicode 6.1的变体选择器,在这种情况下 \U0000FE0E 。要回答我自己的问题:

iOS 6 supports Unicode 6.1's variation selector, in this case \U0000FE0E. To answer my own question:

@"\U000025B6" // a fancy triangle (mapped to Emoji)
@"\U000025B6\U0000FE0E" // black right-pointing triangle

http://www.unicode.org/versions/Unicode6.1.0/

感谢@ martin-r和@ACB,如果没有你的提示,我就不能明白!

Thanks @martin-r and @ACB, I wouldn't be able to figure this out without your hints!

这篇关于UILabel,UIFont和UTF-8三角形的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆