Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/backbone.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Can';t在Visual Studio 2015中添加iOS应用程序图标_Ios_Xamarin_Visual Studio 2015_Xamarin.ios_Xamarin.forms - Fatal编程技术网

Can';t在Visual Studio 2015中添加iOS应用程序图标

Can';t在Visual Studio 2015中添加iOS应用程序图标,ios,xamarin,visual-studio-2015,xamarin.ios,xamarin.forms,Ios,Xamarin,Visual Studio 2015,Xamarin.ios,Xamarin.forms,我有一个Xamarin.Forms项目,想添加iOS应用程序图标。因此,我创建了资产目录,但当我打开它时,我无法添加任何图标: 我正在使用VS2015更新2和最新的Xamarin版本。 我找到了一个关于它应该如何工作的视频: 我不知道为什么我不能添加任何图标,非常感谢您的帮助 Mine Contents.json如下所示: { "images": [], "properties": {}, "info": { "version": 1, "author": "xamarin"

我有一个Xamarin.Forms项目,想添加iOS应用程序图标。因此,我创建了资产目录,但当我打开它时,我无法添加任何图标:

我正在使用VS2015更新2和最新的Xamarin版本。 我找到了一个关于它应该如何工作的视频: 我不知道为什么我不能添加任何图标,非常感谢您的帮助

Mine Contents.json如下所示:

{
 "images": [],
  "properties": {},
 "info": {
  "version": 1,
  "author": "xamarin"
 }
}

您是否能够检查
Contents.json
中的appicon,它可能已损坏?它将出现在
Images.xcasets
AppIcons.appiconset
Contents.json
中,它应该如下所示:

{
  "images": [
    {
      "idiom": "iphone",
      "size": "29x29",
      "scale": "1x"
    },
    {
      "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": "57x57",
      "scale": "1x"
    },
    {
      "idiom": "iphone",
      "size": "57x57",
      "scale": "2x"
    },
    {
      "idiom": "iphone",
      "size": "60x60",
      "scale": "2x"
    },
    {
      "idiom": "iphone",
      "size": "60x60",
      "scale": "3x"
    },
    {
      "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": "50x50",
      "scale": "1x"
    },
    {
      "idiom": "ipad",
      "size": "50x50",
      "scale": "2x"
    },
    {
      "idiom": "ipad",
      "size": "72x72",
      "scale": "1x"
    },
    {
      "idiom": "ipad",
      "size": "72x72",
      "scale": "2x"
    },
    {
      "idiom": "ipad",
      "size": "76x76",
      "scale": "1x"
    },
    {
      "idiom": "ipad",
      "size": "76x76",
      "scale": "2x"
    },
    {
      "idiom": "car",
      "size": "120x120",
      "scale": "1x"
    },
    {
      "size": "24x24",
      "idiom": "watch",
      "scale": "2x",
      "role": "notificationCenter",
      "subtype": "38mm"
    },
    {
      "size": "27.5x27.5",
      "idiom": "watch",
      "scale": "2x",
      "role": "notificationCenter",
      "subtype": "42mm"
    },
    {
      "size": "29x29",
      "idiom": "watch",
      "role": "companionSettings",
      "scale": "2x"
    },
    {
      "size": "29x29",
      "idiom": "watch",
      "role": "companionSettings",
      "scale": "3x"
    },
    {
      "size": "40x40",
      "idiom": "watch",
      "scale": "2x",
      "role": "appLauncher",
      "subtype": "38mm"
    },
    {
      "size": "44x44",
      "idiom": "watch",
      "scale": "2x",
      "role": "longLook",
      "subtype": "42mm"
    },
    {
      "size": "86x86",
      "idiom": "watch",
      "scale": "2x",
      "role": "quickLook",
      "subtype": "38mm"
    },
    {
      "size": "98x98",
      "idiom": "watch",
      "scale": "2x",
      "role": "quickLook",
      "subtype": "42mm"
    }
  ],
  "info": {
    "version": 1,
    "author": "xcode"
  }
}
您可以尝试使用文本编辑器手动编辑xml,以如下方式设置文件名:

{
  "filename": "icon-29.png",
  "size": "29x29",
  "scale": "1x",
  "idiom": "iphone"
},

icon-29.png
将不得不添加到文件夹
AppIcons.appiconset
,但从您的评论来看,我认为它会再次消除它,我认为这是一个bug,并将其归档在这里

这是针对VS的Xamarin插件中的一个已知问题

在VS中,删除所有资产目录。 在Xamarin Studio Mac中打开您的解决方案。添加资源目录。双击Resources/Images.xcsets/AppIcons.appiconset/中的.json文件,它将打开一个工作编辑器。把你的图标放在那里。保存解决方案


现在,您可以在VS中重新打开解决方案。在修复之前(可能需要几个月),请不要再在VS中编辑资产目录。

Mine Content.json几乎为空,请参阅问题更新。我已经用你的版本替换了它,但是没有用。在VS重新启动后,更改被还原。嗯,这似乎不正确,我觉得这可能是一个错误,从Xam.fo上的这个线程来看rumshttps://forums.xamarin.com/discussion/11503/images-xcassets-in-visual-studio/p2 这是VS支持资产目录的一项新功能。我会为它提交一个bug。我可以添加一个带有图像集的Contents.json版本,但我认为它会再次消除它。同样的问题,我的应用程序没有从VS正确部署到模拟器。一切都可以正常编译,但由于找不到资源,应用程序立即崩溃。似乎没有部署PDF资产。在Xamarin工作室工作很好。