iPhone:如何在UILabel字符串文本中添加“度”符号?
问题描述:
答
Shift-option-8?
答
NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:@"80\u00b0c"];
[attributedString setAttributes:@{NSFontAttributeName : [UIFont fontWithName:@"Helvetica-light" size:10.0]
, NSBaselineOffsetAttributeName : @22} range:NSMakeRange(2, 2)];
//asign this as a
examplelabel.attributedtext = attributedString;
答
在斯威夫特
cell.lblTemperature.text = NSString(format:"23%@", "\u{00B0}") as String
答
在Xcode中8.0: 按Ctrl +命令+空格键或Xcode->编辑 - >表情符号&,后来从弹出的页面中搜索度的符号。 您可以轻松添加UILabel或TextView组件。
你是伟人!谢谢。 – Getsy 2010-05-06 18:04:25
nice.super ..... – 2014-02-17 06:50:00
不知道为什么这是问题形式,但它的确是答案。 – Mike 2014-09-19 03:38:04