【发布时间】:2015-01-21 17:53:42
【问题描述】:
我试图在 UIAlectAction 中放置两个 Unicode 符号。我应该有两个圆圈,一个是空的,另一个是满的。我当前的代码是:
NSString *unicodeStar = [NSString stringWithFormat:@"%C %C", 0x25CB,0x25CF];
UIAlertAction* star = [UIAlertAction
actionWithTitle:unicodeStar
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action)
{
[view dismissViewControllerAnimated:YES completion:nil];
}];
[view addAction:star];
根据Unicode Character Table,这两个符号应该具有相同的尺寸,但实际结果是:
所有其他圆圈的尺寸相同。我错过了什么?
【问题讨论】:
-
很可能是字体。尝试不同的字体。顺便说一句 - 不需要
stringWithFormat和十六进制代码。只需:NSString *unicodeStar = @"○ ●"; -
想找一个更大的,但到目前为止我运气不好
-
查看我的更新答案。我找到了一对匹配的。
标签: ios objective-c unicode nsstring uialertaction