objective-c - 如何使用可以键入图像的 Objective-C 制作自定义键盘
问题描述
我想制作一个自定义键盘来输入自定义表情符号,而不仅仅是字母和数字。下面的代码帮助我只输入一个字母或数字
[self.textDocumentProxy insertText:[key currentTitle]];
但是如果我将“currentTitle”更改为“currentImage”,它不会导致正确的操作,因为“insertText”不需要 UIImage。有人可以帮我吗?
解决方案
表情符号是由图像表示的字符。
[self.textDocumentProxy insertText:""];
如果您知道表情符号的代码:
[self.textDocumentProxy insertText:[NSString stringWithFormat:@"%C", 0xe04e]];
推荐阅读
- java - 错误说它被零除,而它没有被初始化为零
- python - 使用没有 NUMPY 的随机数创建 2D 数组(Python)
- javascript - 设置发送到 API 的商家定义数据字段的最大长度
- sql-server - 在 SQL 中获取上个月的最后一天
- java - dl4j 不包含文本和模型模块
- sdk - yocto populate_sdk 有很多警告:包不可安装
- excel - Excel 数据透视表 - 将最高分显示为额外列
- cqengine - 通过 AttributeByteCodeGenerator 创建属性时获取异常“尝试重复的类定义”
- c# - 如何设置ef核心外键字段不为空?
- perl - 如何编写在 HTTP 响应发送到客户端后运行的 Plack 中间件?