像这样在 UILabel 中获得一个看起来正常的 unicode 向下箭头 ⬇ [英] Getting a normal looking unicode down arrow in a UILabel like this ⬇

查看:29
本文介绍了像这样在 UILabel 中获得一个看起来正常的 unicode 向下箭头 ⬇的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在 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 = @"u2B07uFE0E";
// 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屋!

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