IOS 9 快速操作图标
<p><p>我正在尝试在我的图标上使用 3D Touch 时添加快速操作菜单。我的 info.plist 如下所示:</p>
<pre><code><?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>
</code></pre>
<p>不知何故,在下面添加此代码时,在尝试运行项目或尝试使用“属性列表”打开 info.plist 时出现错误。</p>
<pre><code><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>
</code></pre>
<p>错误信息:</p>
<blockquote>
<p>The data couldn’t be read because it isn’t in the correct format.</p>
</blockquote>
<p>有什么想法可能是错的吗?我尝试使用多个不同的代码,但仍然出错。</p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>在常规部分将您的部署目标设置为 9.0。</p>
<p>然后尝试在 info.plist 中用这个替换你的代码。</p>
<pre><code><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>
</code></pre></p>
<p style="font-size: 20px;">关于IOS 9 快速操作图标,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/34055073/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/34055073/
</a>
</p>
页:
[1]