Nee*_*raj 13 iphone icons special-characters uilabel
有没有人知道如何在UILabel文本中显示版权图标?这是c周围有一个圆圈的图标.它的html代码是:©或©.
我尝试了以下代码:
UILabel *contactInfo = [[UILabel alloc] initWithFrame:CGRectMake(-55,135,420,100)];
contactInfo.text = @"'©):'2009 Nationwide ";
Run Code Online (Sandbox Code Playgroud)
要么
contactInfo.text = @"'©'2009 Nationwide ";
Run Code Online (Sandbox Code Playgroud)
要么
contactInfo.text = @"©2009 Nationwide ";
Run Code Online (Sandbox Code Playgroud)
它只是将所有内容打印为文本而不是图标.
这可以在webView中使用,但我需要它作为UILabel文本.有帮助吗?
Pas*_*cal 11
如果您的源文件是UTF-8,它们应该是什么,这应该可以正常工作.否则,您应该将.strings-files与NSLocalizedString()宏结合使用,并将文本放入UTF-16文件中.
适合我: myUILabel.text = @"© by me";
©我的http://www.hillrippers.ch/temp/Screen%20shot%202009-10-23%20at%2018.59.40.png
编辑: 现在我发现你已经尝试将符号作为HTML实体插入 - 这不起作用,只需插入符号即可.
插入符号而不处理源文件的字符编码的另一种方法是使用\x转义将它们编码为UTF-8字节.
根据Fileformat.info,UTF-8字节的版权符号是0xC2 0xA9.
这样可行: @"\xC2\xA9 Nationwide"
这就是我如何做我的全部.