Xamarin forms: Launcher icon for ios

北城以北 提交于 2020-01-04 14:01:34

问题


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.Double-Click the Info.plist file in the Solution Explorer to open it for editing.

2.Scroll down to the App Icons section.

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

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

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.

XSAppIconAssets path in Info.plist is:

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

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

Thanks in advance.


回答1:


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. Right click info.plist and open it with XML(Text)Editor, you can find

    <key>XSAppIconAssets</key>
    <string>Resources/Images.xcassets/AppIcons.appiconset</string>
    
  2. Right click Assets.xcassets and open containing folder , select its parent folder, you can find it locates at YourApp.iOS not Resources.

Solution

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



来源:https://stackoverflow.com/questions/49994279/xamarin-forms-launcher-icon-for-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!