我需要帮助在这样的UILabel中获得正常的unicode向下箭头⬇ [英] I need help 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.
有没有人见过这个?
推荐答案
将某些字符显示为Emojis是一个特征,例如(有争议的)在这里讨论: 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上,不需要变体选择器且不得使用,因为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屋!