[英]How to add Assets Catalog for iOS in Xamarin.Forms?
I am using Xamarin Forms
. 我正在使用Xamarin Forms
。 I was facing one weird issue from the past two days. 过去两天我遇到了一个奇怪的问题。 First I have created App with assets catalog and not included a key for "CFBundleIconName". 首先,我创建了具有资产目录的App,但未包含“CFBundleIconName”的密钥。 Then after just a few minutes, I got an error like 然后在几分钟之后,我得到了一个错误
A value for the Info.plist key 'CFBundleIconName' is missing in the bundle "xxx". 捆绑“xxx”中缺少Info.plist键'CFBundleIconName'的值。
Then after I have tried with assets catalog and removed above key from info.plist file. 然后,我尝试使用资产目录并从info.plist文件中删除上面的密钥。 Then I got an error like 然后我得到了一个错误
Missing Asset Catalog - Your app is missing the asset catalog file 缺少资产目录 - 您的应用程序缺少资产目录文件
If I am removing below lines from a plist file then getting 120X120 icon file missing. 如果我从plist文件中删除下面的行,则会丢失120X120图标文件。
<key>XSAppIconAssets</key>
<string>Media.xcassets\AppIcons.appiconset</string>
<key>CFBundleIcons</key>
<dict>
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconName</key>
<string>icon</string>
<key>CFBundleIconFiles</key>
<array>
<string>icon-20@2x.png</string>
<string>icon-20@3x.png</string>
<string>icon-29@2x.png</string>
<string>icon-29@3x.png</string>
<string>icon-40@2x.png</string>
<string>icon-40@3x.png</string>
<string>icon-60@2x.png</string>
<string>icon-60@3x.png</string>
</array>
</dict>
</dict>
Are the above lines are necessary to include in plist file? 以上行是否必须包含在plist文件中? What other things are necessary to include in plist file. plist文件中还包含哪些其他内容。
And My project structure is : 我的项目结构是:
What is wrong with my code? 我的代码出了什么问题? How can I add all files and assets? 如何添加所有文件和资产? Any idea? 任何的想法?
Delete all images and those lines from the info.plist. 从info.plist中删除所有图像和那些行。
Your Info.Plist should have the following lines: 您的Info.Plist应该包含以下行:
<key>XSAppIconAssets</key>
<string>Assets.xcassets/AppIcon.appiconset</string>
<key>XSLaunchImageAssets</key>
<string>Assets.xcassets/LaunchImage.launchimage</string>
Add all the required icons to Asset Catalogs/Media 将所有必需的图标添加到资产目录/媒体
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.