• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

IOS 9 快速操作图标

[复制链接]
菜鸟教程小白 发表于 2022-12-12 17:29:43 | 显示全部楼层 |阅读模式 打印 上一主题 下一主题

我正在尝试在我的图标上使用 3D Touch 时添加快速操作菜单。我的 info.plist 如下所示:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>UIViewControllerBasedStatusBarAppearance</key>
    <false/>
    <key>CFBundleDevelopmentRegion</key>
    <string>en</string>
    <key>CFBundleExecutable</key>
    <string>$(EXECUTABLE_NAME)</string>
    <key>CFBundleIdentifier</key>
    <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>$(PRODUCT_NAME)</string>
    <key>CFBundlePackageType</key>
    <string>APPL</string>
    <key>CFBundleShortVersionString</key>
    <string>0.3</string>
    <key>CFBundleSignature</key>
    <string>????</string>
    <key>CFBundleVersion</key>
    <string>3</string>
    <key>LSRequiresIPhoneOS</key>
    <true/>
    <key>UIBackgroundModes</key>
    <array>
        <string>remote-notification</string>
    </array>
    <array>
        <dict>
            <key>UIApplicationShortcutItemIconType</key>
            <string>UIApplicationShortcutIconTypeAdd</string>
            <key>UIApplicationShortcutItemTitle</key>
            <string>Home</string>
            <key>UIApplicationShortcutItemType</key>
            <string>quickactions.sweefties.home</string>
        </dict>
        <dict>
            <key>UIApplicationShortcutItemIconFile</key>
            <string>videow</string>
            <key>UIApplicationShortcutItemSubtitle</key>
            <string>Launch video..</string>
            <key>UIApplicationShortcutItemTitle</key>
            <string>Movies</string>
            <key>UIApplicationShortcutItemType</key>
            <string>quickactions.sweefties.movies</string>
        </dict>
        <dict>
            <key>UIApplicationShortcutItemIconType</key>
            <string>UIApplicationShortcutIconTypeShare</string>
            <key>UIApplicationShortcutItemTitle</key>
            <string>Share</string>
            <key>UIApplicationShortcutItemType</key>
            <string>quickactions.sweefties.share</string>
        </dict>
        <dict>
            <key>UIApplicationShortcutItemIconType</key>
            <string>UIApplicationShortcutIconTypeCompose</string>
            <key>UIApplicationShortcutItemTitle</key>
            <string>Message</string>
            <key>UIApplicationShortcutItemType</key>
            <string>quickactions.sweefties.message</string>
        </dict>
    </array>
    <key>UILaunchStoryboardName</key>
    <string>LaunchScreen</string>
    <key>UIMainStoryboardFile</key>
    <string>Main</string>
    <key>UIRequiredDeviceCapabilities</key>
    <array>
        <string>armv7</string>
    </array>
    <key>UIStatusBarStyle</key>
    <string>UIStatusBarStyleLightContent</string>
    <key>UISupportedInterfaceOrientations</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
    </array>
    <key>UISupportedInterfaceOrientations~ipad</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
        <string>UIInterfaceOrientationPortraitUpsideDown</string>
        <string>UIInterfaceOrientationLandscapeLeft</string>
        <string>UIInterfaceOrientationLandscapeRight</string>
    </array>
</dict>
</plist>

不知何故,在下面添加此代码时,在尝试运行项目或尝试使用“属性列表”打开 info.plist 时出现错误。

<array>
        <dict>
            <key>UIApplicationShortcutItemIconType</key>
            <string>UIApplicationShortcutIconTypeAdd</string>
            <key>UIApplicationShortcutItemTitle</key>
            <string>Home</string>
            <key>UIApplicationShortcutItemType</key>
            <string>quickactions.sweefties.home</string>
        </dict>
        <dict>
            <key>UIApplicationShortcutItemIconFile</key>
            <string>videow</string>
            <key>UIApplicationShortcutItemSubtitle</key>
            <string>Launch video..</string>
            <key>UIApplicationShortcutItemTitle</key>
            <string>Movies</string>
            <key>UIApplicationShortcutItemType</key>
            <string>quickactions.sweefties.movies</string>
        </dict>
        <dict>
            <key>UIApplicationShortcutItemIconType</key>
            <string>UIApplicationShortcutIconTypeShare</string>
            <key>UIApplicationShortcutItemTitle</key>
            <string>Share</string>
            <key>UIApplicationShortcutItemType</key>
            <string>quickactions.sweefties.share</string>
        </dict>
        <dict>
            <key>UIApplicationShortcutItemIconType</key>
            <string>UIApplicationShortcutIconTypeCompose</string>
            <key>UIApplicationShortcutItemTitle</key>
            <string>Message</string>
            <key>UIApplicationShortcutItemType</key>
            <string>quickactions.sweefties.message</string>
        </dict>
    </array>

错误信息:

The data couldn’t be read because it isn’t in the correct format.

有什么想法可能是错的吗?我尝试使用多个不同的代码,但仍然出错。



Best Answer-推荐答案


在常规部分将您的部署目标设置为 9.0。

然后尝试在 info.plist 中用这个替换你的代码。

<key>UIApplicationShortcutItems</key>
    <array>
        <dict>
            <key>UIApplicationShortcutItemIconType</key>
            <string>UIApplicationShortcutIconTypeAdd</string>
            <key>UIApplicationShortcutItemTitle</key>
            <string>Home</string>
            <key>UIApplicationShortcutItemType</key>
            <string>quickactions.sweefties.home</string>
        </dict>
        <dict>
            <key>UIApplicationShortcutItemIconFile</key>
            <string>videow</string>
            <key>UIApplicationShortcutItemSubtitle</key>
            <string>Launch video..</string>
            <key>UIApplicationShortcutItemTitle</key>
            <string>Movies</string>
            <key>UIApplicationShortcutItemType</key>
            <string>quickactions.sweefties.movies</string>
        </dict>
        <dict>
            <key>UIApplicationShortcutItemIconType</key>
            <string>UIApplicationShortcutIconTypeShare</string>
            <key>UIApplicationShortcutItemTitle</key>
            <string>Share</string>
            <key>UIApplicationShortcutItemType</key>
            <string>quickactions.sweefties.share</string>
        </dict>
        <dict>
            <key>UIApplicationShortcutItemIconType</key>
            <string>UIApplicationShortcutIconTypeCompose</string>
            <key>UIApplicationShortcutItemTitle</key>
            <string>Message</string>
            <key>UIApplicationShortcutItemType</key>
            <string>quickactions.sweefties.message</string>
        </dict>
    </array>

关于IOS 9 快速操作图标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34055073/

回复

使用道具 举报

懒得打字嘛,点击右侧快捷回复 【右侧内容,后台自定义】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关注0

粉丝2

帖子830918

发布主题
阅读排行 更多
广告位

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap