【问题标题】:Newsstand Icon doesn't show in Xcode 5 iOS 6.1 SDK报亭图标不显示在 Xcode 5 iOS 6.1 SDK 中
【发布时间】:2013-11-29 08:55:36
【问题描述】:

自从将 Xcode 升级到 v5 并将启动和应用程序图标图像转换为图像资产目录后,我一直无法在 iOS 6.1 和 iOS 7 的报刊亭中看到我的应用程序的报刊亭图标。相反,我看到的是常规应用程序图标在它的位置。我仍在针对 iOS SDK 6.1 进行编译,因为 iOS 7 中存在明显的样式更改,我还无法深入测试。

也就是说,这是我在我的报亭图标 icon-newsstand.png 上尝试过的:

  1. 将 icon-newsstand.png 转换为位于 ./Images.xcassets/icon-newsstand.imageset/icon-newsstand.png 的资产目录。
  2. 将 icon-newsstand.png 作为项目的一部分保存在我的 Resources 文件夹中。

这些解决方案都不起作用。这是我的 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>CFBundleDevelopmentRegion</key>
    <string>English</string>
    <key>CFBundleDisplayName</key>
    <string>---- ----</string>
    <key>CFBundleExecutable</key>
    <string>${EXECUTABLE_NAME}</string> 
    <key>CFBundleIcons</key>
    <dict>
        <key>UINewsstandIcon</key>
        <dict>
            <key>CFBundleIconFiles</key>
            <array>
                <string>icon-newsstand.png</string>
            </array>
            <key>UINewsstandBindingEdge</key>
            <string>UINewsstandBindingEdgeLeft</string>
            <key>UINewsstandBindingType</key>
            <string>UINewsstandBindingTypeMagazine</string>
        </dict>
    </dict>
    <key>UIBackgroundModes</key>
    <array>
        <string>newsstand-content</string>
    </array>
    <key>UINewsstandApp</key>
    <true/>
    <key>CFBundleIdentifier</key>
    <string>com.----.----</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.1</string>
    <key>CFBundleName</key>
    <string>---- ----</string>
    <key>CFBundlePackageType</key>
    <string>APPL</string>
    <key>CFBundleSignature</key>
    <string>????</string>
    <key>CFBundleVersion</key>
    <string>2.0.1.13830</string> <!-- The Version of the app. -->
    <key>LSRequiresIPhoneOS</key>
    <true/>
    <key>UIPrerenderedIcon</key>
    <true/>
    <key>UIStatusBarHidden</key>
    <true/>
    <key>UISupportedInterfaceOrientations</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
        <string>UIInterfaceOrientationPortraitUpsideDown</string>
        <string>UIInterfaceOrientationLandscapeLeft</string>
        <string>UIInterfaceOrientationLandscapeRight</string>
    </array>
    <key>UISupportedInterfaceOrientations~ipad</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
        <string>UIInterfaceOrientationPortraitUpsideDown</string>
        <string>UIInterfaceOrientationLandscapeLeft</string>
        <string>UIInterfaceOrientationLandscapeRight</string>
    </array>
    <key>CFBundleURLTypes</key>
    <array>
        <dict>
            <key>CFBundleTypeRole</key>
            <string>Editor</string>
            <key>CFBundleURLName</key>
            <string>FB Connect</string>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>fb150871295037449------</string><!-- The app id must be appended to the end of this string. Example: <string>fb150871295037449connections</string>  -->
            </array>
        </dict>
    </array>
</dict>
</plist>

在升级 Xcode 并转换为图像资产目录之后,有没有人遇到过这种情况?有没有人知道从哪里开始对我的项目进行更改?到目前为止,从我的搜索来看,在线和 StackOverflow 上关于报亭和 Xcode 5 问题的详细信息很少。

非常感谢任何帮助。谢谢!

【问题讨论】:

    标签: ios xcode xcode5 newsstand-kit asset-catalog


    【解决方案1】:

    我发现这个问题只发生在 iPad 上。自从发现之后,我意识到我的 info.plist 中缺少一个部分,如下所示:

        <key>CFBundleIcons~ipad</key>
        <dict>
            <key>UINewsstandIcon</key>
            <dict>
                <key>CFBundleIconFiles</key>
                <array>
                    <string>icon-newsstand.png</string>
                </array>
                <key>UINewsstandBindingEdge</key>
                <string>UINewsstandBindingEdgeLeft</string>
                <key>UINewsstandBindingType</key>
                <string>UINewsstandBindingTypeMagazine</string>
            </dict>
        </dict>
    

    谜团解开!

    【讨论】:

    • 我遇到了和你一样的问题,但我已经有了那个部分。更重要的是,看看你上面的问题,我可以在你发布的原始代码中看到完全相同的部分。除了主应用程序 info.plist 之外,还有其他地方需要放置此代码以使其在 iPad 上运行吗?
    猜你喜欢
    • 2013-01-31
    • 2013-10-07
    • 2015-01-11
    • 2014-07-10
    • 1970-01-01
    • 1970-01-01
    • 2013-10-10
    • 2018-04-26
    • 1970-01-01
    相关资源
    最近更新 更多