当Android没有这个问题时,如何修复Xamarin.Forms iOS在标题栏图像和标题栏背景上的色差
我有一张背景色为F6D401的图像(大小与横幅一样),需要转到TopBar进行品牌宣传 在App.xaml I set中:当Android没有这个问题时,如何修复Xamarin.Forms iOS在标题栏图像和标题栏背景上的色差,xamarin.forms,view,colors,xamarin.android,xamarin.ios,Xamarin.forms,View,Colors,Xamarin.android,Xamarin.ios,我有一张背景色为F6D401的图像(大小与横幅一样),需要转到TopBar进行品牌宣传 在App.xaml I set中: <Application.Resources> <ResourceDictionary> <Color x:Key="Primary">#f6d401</Color> <Color x:Key="TextColor"&
<Application.Resources>
<ResourceDictionary>
<Color x:Key="Primary">#f6d401</Color>
<Color x:Key="TextColor">#5a5a5a</Color>
然而,在iOS上,颜色似乎不匹配
我假设iOS上有一个默认设置,需要更改
如何使横幅和图标颜色匹配?请添加UINavigationBar.Appearance.Translucent=false代码>至AppDelegate.cs
public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
{
//
// This method is invoked when the application has loaded and is ready to run. In this
// method you should instantiate the window, load the UI into it and then make the window
// visible.
//
// You have 17 seconds to return from this method, or iOS will terminate your application.
//
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
UINavigationBar.Appearance.Translucent = false;
global::Xamarin.Forms.Forms.Init();
LoadApplication(new App());
return base.FinishedLaunching(app, options);
}
}
下面是跑步截图
<Shell.TitleView>
<Image
HorizontalOptions="Center"
VerticalOptions="Center"
Source="logo.png" />
</Shell.TitleView>
public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
{
//
// This method is invoked when the application has loaded and is ready to run. In this
// method you should instantiate the window, load the UI into it and then make the window
// visible.
//
// You have 17 seconds to return from this method, or iOS will terminate your application.
//
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
UINavigationBar.Appearance.Translucent = false;
global::Xamarin.Forms.Forms.Init();
LoadApplication(new App());
return base.FinishedLaunching(app, options);
}
}