如何在Xamarin.Forms中更改应用程序图标?

编程入门 行业动态 更新时间:2024-10-27 16:30:14
本文介绍了如何在Xamarin.Forms中更改应用程序图标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我替换了所有位置的所有图像(这意味着在可绘制文件夹,所有Windows Assets文件夹和iOS Resources文件夹中),但是它仍然显示了该应用程序的默认Xamarin图标.我也尝试了这段代码,但是它似乎也不起作用.有人可以告诉我解决方案吗?

I replaced all the images everywhere (by this I mean in drawable folders and all Windows Assets folders and iOS Resources folder), but it still shows me the default Xamarin icon for the app. I tried this code, too, but it doesn't seem to work either. Can someone tell me the solution?

[assembly: Application(Icon = "@drawable/icon")]

推荐答案

对于Android,请尝试如下设置图标应用程序:

For Android try to set the icon app like this:

[Activity(Icon = "@drawable/icon")] public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsApplicationActivity { ..... }

确保已更改所有可绘制文件夹(drawable,drawable-hdpi,drawable-xhdpi和drawable-xxhdpi)上的所有图标图像.

Make sure that you have changed all the icon images on all drawable folders ( drawable, drawable-hdpi, drawable-xhdpi and drawable-xxhdpi ).

对于iOS,我喜欢使用Asset Catalogs设置应用程序图标和启动屏幕,在这里您可以找到使用方法的指南:

For iOS I like set the app icons and splash screen with Asset Catalogs, here you can find a guide to how to use it:

developer.xamarin/guides/ios/application_fundamentals/working_with_images/app-icons/

更多推荐

如何在Xamarin.Forms中更改应用程序图标?

本文发布于:2023-10-07 01:32:32,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1468062.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序   图标   如何在   Forms   Xamarin

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!