1

我正在使用以下 UNICODES 在 iPad 上设计表情菜单,但我无法自定义其高度。

arrayEmoticons=[[NSArray alloc]initWithObjects:@"\U0001F61D",
                @"\U0001F621",@"\U0001F61C",@"\U0001F47F",@"\U0001F603",
                @"\U0001F60D",@"\U0001F612",@"\U0001F637",@"\U0001F614",
                @"\U0001F60A",@"\U0001F633",@"\U0001F631",@"\U0001F628",
                @"\U0001F609",@"\U0001F601", nil];

我需要增加 unicode 字符的高度/宽度。

4

1 回答 1

2

您永远不会更改 unicode 值的大小,而是需要更改 textField 或 textView 的大小。

我对osx应用程序的以下代码做了同样的事情

NSArray *arrayEmoticons=[[NSArray alloc]initWithObjects:@"\U0001F61D",
                @"\U0001F621",@"\U0001F61C",@"\U0001F47F",@"\U0001F603",
                @"\U0001F60D",@"\U0001F612",@"\U0001F637",@"\U0001F614",
                @"\U0001F60A",@"\U0001F633",@"\U0001F631",@"\U0001F628",
                @"\U0001F609",@"\U0001F601", nil];

NSLog(@"%@",arrayEmoticons);

[self.textView setFont:[NSFont fontWithName:@"Helvetica-BoldOblique" size:30.0]];


for (id icon in arrayEmoticons) {
  [self.textView setString:[NSString stringWithFormat:@"%@%@",self.textView.string,icon]];
}

并得到了很好的输出: 在此处输入图像描述

编辑:

对于 NSButton:

[self.button setFont:[NSFont fontWithName:@"Helvetica-BoldOblique" size:30.0]]; 
[self.button setTitle:arrayEmoticons[3]];

对于 iOS:

现在我尝试使用 ios,它成功了。您可以检查尺寸 5 和 50 的差异

self.button.titleLabel.font = [UIFont systemFontOfSize:5]; 
self.button.titleLabel.font = [UIFont systemFontOfSize:50];  
self.button.titleLabel.text=arrayEmoticons[3];
于 2013-03-02T07:31:35.207 回答