3

(请在回答之前先检查链接,这样你就可以得到我想说的)我已经检查了github 中的代码,在 Xcode 中我在这个中找到了类似这样的代码,它甚至工作得很好

[[NSArray arrayWithObjects:
                      @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"✨", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", nil]retain];

编辑:- 如何直接在数组中添加图像或表情符号键盘如何在 Xcode 编辑器中启用?

4

4 回答 4

4

这是 Unicode 字符。记录那个 NSArray。

\Ud83d\Ude04 - 微笑的脸,张开嘴和微笑的眼睛

在此处输入图像描述

   "\Ud83d\Ude04",
"\Ud83d\Ude0a",
"\Ud83d\Ude03",
"\Ud83d\Ude09",
"\Ud83d\Ude0d",
"\Ud83d\Ude18",
"\Ud83d\Ude1a",
"\Ud83d\Ude33",
"\Ud83d\Ude0c",
"\Ud83d\Ude01",
"\Ud83d\Ude1c",
"\Ud83d\Ude1d",
"\Ud83d\Ude12",
"\Ud83d\Ude0f",
"\Ud83d\Ude13",
"\Ud83d\Ude14",
"\Ud83d\Ude1e",
"\Ud83d\Ude16",
"\Ud83d\Ude25",
"\Ud83d\Ude30",
"\Ud83d\Ude28",
"\Ud83d\Ude23",
"\Ud83d\Ude22",
"\Ud83d\Ude2d",
"\Ud83d\Ude02",
"\Ud83d\Ude32",
"\Ud83d\Ude31",
"\Ud83d\Ude20",
"\Ud83d\Ude21",
"\Ud83d\Ude2a",
"\Ud83d\Ude37",
"\Ud83d\Udc7f",
"\Ud83d\Udc7d",
"\Ud83d\Udc9b",
"\Ud83d\Udc99",
"\Ud83d\Udc9c",
"\Ud83d\Udc97",
"\Ud83d\Udc9a",
"\Ud83d\Udc94",
"\Ud83d\Udc93",
"\Ud83d\Udc98\U2728",
"\Ud83c\Udf1f",
"\Ud83d\Udca4",
"\Ud83c\Udfb5",
"\Ud83d\Udd25",
"\Ud83d\Udca9",
"\Ud83d\Udc4d",
"\Ud83d\Udc4e",
"\Ud83d\Udc4c",
"\Ud83d\Udc9d",
"\Ud83c\Udf8e",
"\Ud83c\Udf92",
"\Ud83c\Udf93",
"\Ud83c\Udf8f",
"\Ud83c\Udf86",
"\Ud83c\Udf83",
"\Ud83c\Udf84",
"\Ud83c\Udf81",
"\Ud83d\Udd14",
"\Ud83d\Udcbf",
"\Ud83d\Udcf7",
"\Ud83d\Udcbb",
"\Ud83d\Udca1"

看看如何在 Interface Builder 的 UILabel 中输入 unicode 字符?

您可以点击 Edit->Special Characters... - 在那里您可以找到所有 unicode 字符(包括表情符号)

于 2013-07-22T06:55:34.817 回答
3

如果您的问题是如何将 Emoji 字符直接输入到源代码中:

  • 在系统偏好设置 -> 键盘中,激活“在菜单栏中显示键盘和字符查看器”选项。
  • 从菜单栏中选择“显示字符查看器”。
  • 如有必要,从左上角弹出窗口中选择“自定义列表...”并激活“表情符号”类别。
  • 在左栏中选择“表情符号”类别。
  • 双击任意字符直接插入源代码:

在此处输入图像描述

于 2013-07-22T07:09:22.090 回答
3

无需 unicode,您可以像这样简单地拖放笑脸:-

看到这个你需要打开特殊字符,如下图所示:-

在此处输入图像描述

然后窗口像这样打开:-

在此处输入图像描述

现在你只需拖动你想在数组中显示的笑脸作为你的问题:

 [[NSArray arrayWithObjects:@"",@"✅"nil]retain];
于 2013-07-22T07:14:49.023 回答
1
NSArray *arr = [[NSArray alloc] initWithObjects:[UIImage imageNamed:@"1.png"],[UIImage imageNamed:@"2.png"],[UIImage imageNamed:@"3.png"], nil];
于 2013-07-22T06:49:03.457 回答