Xamarin形式:iOS的启动器图标 [英] Xamarin forms: Launcher icon for ios

查看:256
本文介绍了Xamarin形式:iOS的启动器图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为Mac上的xamarin Forms ios项目设置启动器图标.

I am trying to set the launcher icon for xamarin forms ios project from Mac.

我做了以下事情,但仍显示默认图标.

I do the following things but still showing the default icon.

1.双击解决方案资源管理器中的Info.plist文件以将其打开以进行编辑.

1.Double-Click the Info.plist file in the Solution Explorer to open it for editing.

2.向下滚动到应用程序图标"部分.

2.Scroll down to the App Icons section.

3.从Source下拉列表中,选择AppIcon-1.

3.From the Source dropdown list, select AppIcon-1.

4.打开Assets.xcassets,然后从列表中选择应用程序图标.

4.Open Assets.xcassets and select App icons from the list.

5.选择所需类型的图像文件(未选中"Prerendered"选项).某些图标已经填充了默认图标,如果我更改该图标,将会得到找不到文件的错误.

5.Select the image file for the required type(Prerendered option is not checked). Some icons are already filled with the default icon and if I change that will get the file not found error.

Info.plist中的XSAppIconAssets路径为:

XSAppIconAssets path in Info.plist is:

<key>XSAppIconAssets</key>
<string>Assets.xcassets/AppIcon-1.appiconset</string>

此任务还有其他设置吗?我引用此博客: https://docs.microsoft.com/zh-cn/xamarin/ios/app-fundamentals/images-icons/app-icons?tabs=vsmac

Is there any additional set up for this task? I refer this blog: https://docs.microsoft.com/en-us/xamarin/ios/app-fundamentals/images-icons/app-icons?tabs=vsmac

谢谢.

推荐答案

这是因为Assets file pathinfo.plist中的值不匹配,因此您的应用程序找不到它,因此请使用默认图标.

It is because that Assets file path doesn't match the vaule in info.plist, your application cannot find it so use the default icons.

  1. 右键单击info.plist并用XML(Text)Editor打开,即可找到

<key>XSAppIconAssets</key>
<string>Resources/Images.xcassets/AppIcons.appiconset</string>

  • 右键单击Assets.xcassets并打开包含文件夹,选择其父文件夹,您会发现它位于YourApp.iOS而不是Resources.

  • Right click Assets.xcassets and open containing folder , select its parent folder, you can find it locates at YourApp.iOS not Resources.

    解决方案

    XSAppIconAssetsResources/Images.xcassets/AppIcons.appiconset更改为Images.xcassets/AppIcons.appiconset,它应该能够解决该问题.

    Solution

    Change XSAppIconAssets from Resources/Images.xcassets/AppIcons.appiconset to Images.xcassets/AppIcons.appiconset , it should be able to solve the issue.

    这篇关于Xamarin形式:iOS的启动器图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆