【发布时间】:2016-08-19 21:58:32
【问题描述】:
如何在 Xamarin.Forms - android 中设置不同的图标。
一个用于应用程序、Play 商店、用户屏幕和其他用于导航页面。
我更新了 Project.Droid/MainActivity.cs 文件:
[Activity(Label = "MyAppName", Icon = "MyIconName", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
但是这样换两个图标!!
我做的其他方式,我更新了 ProjectForms/App.cs:
Current.Resources = new ResourceDictionary();
Current.Resources.Add("UlycesColor", Color.FromRgb(121, 248, 81));
var navigationStyle = new Style(typeof(NavigationPage));
var barTextColorSetter = new Setter { Property = NavigationPage.BarTextColorProperty, Value = Color.Black };
var barBackgroundColorSetter = new Setter { Property = NavigationPage.BarBackgroundColorProperty, Value = Color.White };
var barIcon = new Setter { Property = NavigationPage.IconProperty, Value = "newIcon.png" };
navigationStyle.Setters.Add(barTextColorSetter);
navigationStyle.Setters.Add(barBackgroundColorSetter);
navigationStyle.Setters.Add(barIcon);
Current.Resources.Add(navigationStyle);
但是不行!!
知道吗???
【问题讨论】:
标签: c# xamarin xamarin.android xamarin.forms