像这样在UILabel中获取正常外观的Unicode向下箭头⬇ [英] Getting a normal looking unicode down arrow in a UILabel like this ⬇
问题描述
我想获得一个向下箭头以显示在UILabel中.特别是⬇Unicode:U + 2B07.这是列标题上的显示排序顺序.
I would like to get a down arrow to display inside a UILabel. Specifically ⬇ Unicode: U+2B07. This is show sort order on a column header.
我已经看到了显示unicode字符的代码,当我将其用于上面的符号时,它没有按预期显示,而是带有光泽的蓝色向下箭头.
I have seen the code to get unicode characters to display and when I use it for the symbol above it doesn't display as expected but rather comes up with a blue down arrow with gloss.
有人看过吗?
推荐答案
将某些字符显示为表情符号"是一种功能,例如(有争议)在此处进行了讨论: https://devforums.apple.com/message/487463#487463 (需要Apple Developer登录).此功能是iOS 6中引入的.
Displaying some characters as "Emojis" is a feature which is e.g. (controversially) discussed here: https://devforums.apple.com/message/487463#487463 (requires Apple Developer login). This feature was introduced in iOS 6.
一种解决方案(来自 https://stackoverflow.com/a/13836045/1187415 )是附加Unicode的变量选择器" U + FE0E,例如
A solution (from https://stackoverflow.com/a/13836045/1187415) is to append the Unicode "Variation selector" U+FE0E, e.g.
self.myLabel.text = @"\u2B07\uFE0E";
// or:
self.myLabel.text = @"⬇\uFE0E";
请注意,在iOS< = 5.x上,不需要使用Variation选择器,并且必须使用 ,因为iOS 5会将其显示为方框.
Note that on iOS <= 5.x, the Variation selector is not necessary and must not be used, because iOS 5 would display it as a box.
在 Swift 中应该是
myLabel.text = "⬇\u{FE0E}"
这篇关于像这样在UILabel中获取正常外观的Unicode向下箭头⬇的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!