1
如何在Xamarin.Forms - android中設置不同的圖標。更改導航欄上的圖標 - Xamarin.Forms Android
一個用於應用程序,玩商店,用戶屏幕和其他導航頁面。
我更新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);
但不起作用!
任何想法???
優秀。這是正確的方法。非常感謝!!!! – hagnr
如何在ios中執行此操作? –