有一些很棒的“快速操作图标”可用https://developer.apple.com/ios/ human-interface-guidelines/graphics/system-icons/ https://developer.apple.com/ios/human-interface-guidelines/graphics/system-icons/.
是否有可能制作一个UIImage
来自其中之一UIApplicationShortcutIcon
s 用于,比如说,UIButton
。例如,邮件图标:
let mailIcon = UIApplicationShortcutIcon(type: .mail)
let mailImage = UIImage( ... )
任何帮助,将不胜感激。谢谢。
你不能使用Quick Action Icons
作为普通图像或无法设置在按钮图像中。这些仅适用于 3D 触摸快捷方式。当您按下应用程序图标时,它会显示快捷菜单以供快速操作。您可以在此处使用这些图标。它甚至允许使用我们的图像作为快速操作图标。
您也可以参考以下网址作为参考:
- 如何将自定义图像添加为 UIApplicationShortcutItem 的 UIApplicationShortcutIcon? https://stackoverflow.com/questions/36130654/how-to-add-custom-images-as-uiapplicationshortcuticon-for-uiapplicationshortcuti
- UIApplicationShortcutItem - 我可以使用从网络下载的图像作为 UIApplicationShortcutIcon 吗? https://stackoverflow.com/questions/33098000/uiapplicationshortcutitem-can-i-use-an-image-downloaded-from-the-web-as-uiappl
- https://developer.apple.com/reference/uikit/uiapplicationshortcuticon https://developer.apple.com/reference/uikit/uiapplicationshortcuticon
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)