Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/101.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
粗体箭头的Unicode符号在UILabel iOS 7中显示不正确的UI_Ios_Objective C_Unicode - Fatal编程技术网

粗体箭头的Unicode符号在UILabel iOS 7中显示不正确的UI

粗体箭头的Unicode符号在UILabel iOS 7中显示不正确的UI,ios,objective-c,unicode,Ios,Objective C,Unicode,我使用unicode符号表示此链接中的粗体向上和向下箭头 但它在箭头周围显示蓝色框,如下面的屏幕截图所示 我的代码如下 NSString *strMore = @"\u2B06" ; NSString *strLess = @"\u2B07" ; self.lblMore.text = strMore; self.lblLess.text = strLess; 有人能告诉我出了什么问题吗?带蓝色框的箭头是Emoji箭头,其Unicode编码相同。在OS X上打开字符查看器(Control+

我使用unicode符号表示此链接中的粗体向上和向下箭头

但它在箭头周围显示蓝色框,如下面的屏幕截图所示

我的代码如下

NSString *strMore = @"\u2B06" ;
NSString *strLess = @"\u2B07" ;

self.lblMore.text = strMore;
self.lblLess.text = strLess;

有人能告诉我出了什么问题吗?

带蓝色框的箭头是
Emoji
箭头,其Unicode编码相同。在OS X上打开字符查看器(Control+Option+Space)以查找代码,并在左窗格的
箭头中检查Unicode。使用unicode应该可以解决这个问题,因为它不会弄乱表情符号箭头代码

更新对不起,我目前无法访问Mac电脑,因此我无法自己查找代码。显然,如果将
\U0000FE0E
添加到unicode中,将避免使用表情符号。因此,在你的情况下:

而不是:

NSString *strMore = @"\u2B06" ; //This will map the character to the Emoji icon; the blue up arrow.
NSString *strLess = @"\u2B07" ; //This will map the character to the Emoji icon; the blue down arrow.
写:

NSString *strMore = @"\u2B06\U0000FE0E" ; //This will disable Emoji character mapping and will display the proper unicode character, the black up arrow here.
NSString *strLess = @"\u2B07\U0000FE0E" ; //This will disable Emoji character mapping and will display the proper unicode character, the black down arrow here.
让我知道这是否有效

第二次更新:


很高兴它成功了!在确保它工作之前不想引用。显然,苹果的付费开发者论坛中提到了这一点。和中也提到了它。

带有蓝色框的箭头是带有相同Unicode的
表情符号。在OS X上打开字符查看器(Control+Option+Space)以查找代码,并在左窗格的
箭头中检查Unicode。使用unicode应该可以解决这个问题,因为它不会弄乱表情符号箭头代码

更新对不起,我目前无法访问Mac电脑,因此我无法自己查找代码。显然,如果将
\U0000FE0E
添加到unicode中,将避免使用表情符号。因此,在你的情况下:

而不是:

NSString *strMore = @"\u2B06" ; //This will map the character to the Emoji icon; the blue up arrow.
NSString *strLess = @"\u2B07" ; //This will map the character to the Emoji icon; the blue down arrow.
写:

NSString *strMore = @"\u2B06\U0000FE0E" ; //This will disable Emoji character mapping and will display the proper unicode character, the black up arrow here.
NSString *strLess = @"\u2B07\U0000FE0E" ; //This will disable Emoji character mapping and will display the proper unicode character, the black down arrow here.
让我知道这是否有效

第二次更新:


很高兴它成功了!在确保它工作之前不想引用。显然,苹果的付费开发者论坛中提到了这一点。和中也提到了它。

是否仅由本文处理,或者您是否也使用故事板?它只是xib文件中的UILabel。我没有使用故事板,它只由本文处理,或者您也在使用故事板?它只是xib文件中的一个UILabel。我没有使用故事板谢谢你的截图。但在Character Viewer中,它也显示了我当前使用的相同符号。对不起,我现在在一台破旧的Windows机器上,这就是为什么我自己无法检查它的原因。查看更新的答案。感谢Neeku提供更新的答案。这个很好用:)非常感谢。出于好奇,您告诉我如果您在unicode中添加\U0000FE0E,将避免使用表情符号。
-您在哪里找到的?你能分享我需要学习的链接吗:)当然!这就是答案的另一个更新!不确定为什么所有这些示例都使用宽Unicode转义符
\U
,此变体选择器是一个BMP字符,可以作为
\uFE0E
访问。感谢您的屏幕截图。但在Character Viewer中,它也显示了我当前使用的相同符号。对不起,我现在在一台破旧的Windows机器上,这就是为什么我自己无法检查它的原因。查看更新的答案。感谢Neeku提供更新的答案。这个很好用:)非常感谢。出于好奇,您告诉我如果您在unicode中添加\U0000FE0E,将避免使用表情符号。
-您在哪里找到的?你能分享我需要学习的链接吗:)当然!这就是答案的另一个更新!不确定为什么所有这些示例都使用宽Unicode转义符
\U
,此变体选择器是一个BMP字符,可以作为
\uFE0E
访问。