来自UIApplicationShortcutIcon的UIImage [英] UIImage from UIApplicationShortcutIcon
问题描述
提供了一些很棒的快速操作图标 https://developer.apple.com/ios/human-interface-guidelines/graphics/system-icons/ 。
是否可以制作一个来自其中一个 UIApplicationShortcutIcon
的 UIImage
用于,例如, UIButton
。例如,邮件图标:
Is it possible to make a UIImage
from one of these UIApplicationShortcutIcon
s to use on, say, a UIButton
. For example, the mail icon:
let mailIcon = UIApplicationShortcutIcon(type: .mail)
let mailImage = UIImage( ... )
任何帮助将不胜感激。谢谢。
Any help would be appreciated. Thanks.
推荐答案
您无法使用快速操作图标
作为普通图像或者无法在按钮图像中设置。这些仅适用于3D触摸快捷方式。当您按下应用程序图标时,它会显示快捷菜单以便快速操作。您可以在此处使用这些图标。即使它允许使用我们的图像作为快速动作图标。
You cannot use Quick Action Icons
as an normal image or cannot set in a button image. These are only for 3D touch shortcuts. When you press on application icon and it display shortcut menu for quick action. You can use these icons here. Even it allows to use our images as an quick action icons.
您也可以参考以下网址作为参考:
Also you can refer below URLs as a reference :
- 如何添加自定义图像为UIApplicationShortcutIcon用于UIApplicationShortcutItem?
- UIApplicationShortcutItem - 我可以使用从网上下载的图像作为UIApplicationShortcutIcon吗?
- https://developer.apple.com/reference/uikit/uiapplicationshortcuticon
- How to add custom images as UIApplicationShortcutIcon for UIApplicationShortcutItem?
- UIApplicationShortcutItem - Can I use an image downloaded from the web as UIApplicationShortcutIcon?
- https://developer.apple.com/reference/uikit/uiapplicationshortcuticon
这篇关于来自UIApplicationShortcutIcon的UIImage的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!