来自UIApplicationShortcutIcon的UIImage [英] UIImage from UIApplicationShortcutIcon

查看:479
本文介绍了来自UIApplicationShortcutIcon的UIImage的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

提供了一些很棒的快速操作图标 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 UIApplicationShortcutIcons 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 :


  1. 如何添加自定义图像为UIApplicationShortcutIcon用于UIApplicationShortcutItem?

  2. UIApplicationShortcutItem - 我可以使用从网上下载的图像作为UIApplicationShortcutIcon吗?

  3. https://developer.apple.com/reference/uikit/uiapplicationshortcuticon

  1. How to add custom images as UIApplicationShortcutIcon for UIApplicationShortcutItem?
  2. UIApplicationShortcutItem - Can I use an image downloaded from the web as UIApplicationShortcutIcon?
  3. https://developer.apple.com/reference/uikit/uiapplicationshortcuticon

这篇关于来自UIApplicationShortcutIcon的UIImage的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆