1
Xamarin.Forms - Androidでさまざまなアイコンを設定する方法を教えてください。ナビゲーションバーのアイコンを変更する - Xamarin.Forms Android
ナビゲーションページのアプリケーション、プレイストア、ユーザー画面などのためのものです。
私はProject.Droid/MainActivity.csファイル更新:
[Activity(Label = "MyAppName", Icon = "MyIconName", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
しかし、この方法の変更の2つのアイコンを!!
私は、私は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);
しかし、動作しませんが!
優れ
は
Resources/drawable
フォルダにアイコンを追加します。これは正しい方法です。どうもありがとう!!!! – hagnriosでこれを行う方法は? –