【问题标题】:iphone app does not display icon on ipad [duplicate]iphone应用程序在ipad上不显示图标[重复]
【发布时间】:2017-07-06 04:39:20
【问题描述】:

我正在为 iPhone 设备构建一个应用程序(“设备”在 mon only 目标的“常规”选项卡中设置为“iPhone”)。在 iPad 模拟器(或真正的 iPad)上运行时,我没有正确的图标(在 iphone 上正确显示的图标)。

请注意,我的 AppIcon 是在 Images.xcassets 中定义的。请参阅here 我的资产截图。

有什么想法吗?

【问题讨论】:

  • 可以分享Images.xcassets中设置的Appicon资产截图吗?
  • 可能你没有为 iPad 设置应用图标。应用图标资产的屏幕截图将有助于更好地调试。

标签: ios iphone xcode ipad icons


【解决方案1】:

在该屏幕截图中,您似乎只加载了 iPhone 图标。您的应用程序是否在主要设置中同时设置为 iPhone 和 iPad?您可能必须创建一个新项目,并将“设备”设置为“通用”,以便 iPad 选项显示在 AppIcon 文件中(请参见下图,您需要的外观)。

如果您不想创建一个全新的项目,请在查找器中打开您的 AppIcon 文件,擦除所有内容,将下面的代码粘贴进去,保存并再次添加所有 iPhone 和 iPad 图像。

{
"images" : [
{
  "idiom" : "iphone",
  "size" : "20x20",
  "scale" : "2x"
},
{
  "idiom" : "iphone",
  "size" : "20x20",
  "scale" : "3x"
},
{
  "idiom" : "iphone",
  "size" : "29x29",
  "scale" : "2x"
},
{
  "idiom" : "iphone",
  "size" : "29x29",
  "scale" : "3x"
},
{
  "idiom" : "iphone",
  "size" : "40x40",
  "scale" : "2x"
},
{
  "idiom" : "iphone",
  "size" : "40x40",
  "scale" : "3x"
},
{
  "idiom" : "iphone",
  "size" : "60x60",
  "scale" : "2x"
},
{
  "idiom" : "iphone",
  "size" : "60x60",
  "scale" : "3x"
},
{
  "idiom" : "ipad",
  "size" : "20x20",
  "scale" : "1x"
},
{
  "idiom" : "ipad",
  "size" : "20x20",
  "scale" : "2x"
},
{
  "idiom" : "ipad",
  "size" : "29x29",
  "scale" : "1x"
},
{
  "idiom" : "ipad",
  "size" : "29x29",
  "scale" : "2x"
},
{
  "idiom" : "ipad",
  "size" : "40x40",
  "scale" : "1x"
},
{
  "idiom" : "ipad",
  "size" : "40x40",
  "scale" : "2x"
},
{
  "idiom" : "ipad",
  "size" : "76x76",
  "scale" : "1x"
},
{
  "idiom" : "ipad",
  "size" : "76x76",
  "scale" : "2x"
},
{
  "idiom" : "ipad",
  "size" : "83.5x83.5",
  "scale" : "2x"
}
],
"info" : {
  "version" : 1,
  "author" : "xcode"
}
}

【讨论】:

  • 我已将设备设置为 iphone 而不是通用的。出于这个原因,我认为 iPad 的东西没有用。我不想通用,因为 UI 还没有为此做好准备。在 iPad 上,我只想要 iPhone 的 x2 放大版。
  • 好的,解决方案是将设备切换到通用并重新创建一组 if 图标。现在所有的 ipad 变种都在里面。删除旧集(并拖放所有正确的图标)并重命名新的 AppIcon。将设备切换回iphone。在 ipad 上运行时“瞧”,图标就在这里。顺便说一句,仍然不明白没有像这样准备的图标如何具有正确的图标(我的意思是当 iPad 推出时,仍在使用旧的 iphone 应用程序和正确的图标)。谢谢大家强迫我测试这个。
猜你喜欢
  • 1970-01-01
  • 2014-02-13
  • 2012-03-24
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-03-27
  • 2012-09-02
  • 1970-01-01
相关资源
最近更新 更多