macos - macOS 上 NSPopover 中的表情符号列表,如 Messages App
问题描述
我想NSPopover
在我的 Mac 应用程序中显示一个列出表情符号的应用程序,就像 Apple 的 Messages 应用程序一样:
到目前为止,我能想到的是,我可以使用以下方法在我的应用程序中显示字符调色板:
NSApp.orderFrontCharacterPalette(nil)
有谁知道我如何将调色板嵌入到NSPopover
我的应用程序中并检索选定的表情符号(类似于 Apple 在 Messages 中的操作方式)?
解决方案
将您的 textView、textField 或任何其他视图设置为NSApp.orderFrontCharacterPalette(_:)
.
NSApp.orderFrontCharacterPalette(self.textField)
推荐阅读
- python - 如何使用 Python 库 Xarray 将聚合维度添加到 netcdf4 文件?
- c - 如何在字符串打印循环中打印字符之间产生延迟?
- sql - 将查询从 Sybase IQ 转换为 impala
- javascript - 单击按钮时将内容附加到 HTML 并删除附加的内容
- java - java.io.IOException:尝试从 IBM Cloud Object Storage 读取 Spark 集群中的 parquet 文件时,无法读取文件 FileStatus 的页脚
- c++ - 在某个命名空间中定义方法时在全局命名空间中声明?
- sql - 获取嵌套 JSON 列的值
- r - 如何解析和提取凌乱的 Excel 数据?
- python - cv2.cornerHarris 返回什么?
- arduino - 使用 Arduino Mega 作为 I2C 从设备和 RPi3