【发布时间】:2015-12-09 20:12:15
【问题描述】:
我目前正在使用 3D Touch 为我的 iOS 9 应用实现主屏幕快速操作。我有几个使用来自已定义 UIApplicationShortcutIconType 枚举的现有系统图标的操作。
一个例子:
<dict>
<key>UIApplicationShortcutItemIconType</key>
<string>UIApplicationShortcutIconTypeSearch</string>
<key>UIApplicationShortcutItemTitle</key>
<string>Search for Parking</string>
<key>UIApplicationShortcutItemType</key>
<string>SEARCH</string>
</dict>
但是,对于其中一个操作,我想使用自定义图标。我尝试将 UIApplicationShortcutItemIconType 字符串替换为我的图像资产的名称,但这不起作用。
使用 UIApplicationShortcutIcon.iconWithTemplateImageName() 对动态操作很容易做到,但此操作需要是静态的。
【问题讨论】:
标签: ios ios9 3dtouch uiapplicationshortcutitem