1.Navigationbar color & also the tabs background color is very light , when compared to the original color(#132241). It is fine in android . When i deploy in IOS, the color is very light and not matching the original.
Download xaminals sample project from
https://docs.microsoft.com/en-gb/samples/xamarin/xamarin-forms-samples/userinterface-xaminals/
Replace "Shell.BackgroundColor" with "#132241" in "DomesticShell" style (AppShell.Xaml) as shown below.
TargetType="Element"
BasedOn="{StaticResource BaseStyle}">
Same as the colour in android device
Difference in both platforms;
I tried adding the following line in appdelegate.cs
UINavigationBar.Appearance.Translucent = false;
UITabBar.Appearance.BackgroundColor = UIColor.FromRGB(19, 34, 65);
succeeded in getting the navigationbar color and bottom tab background color , but the top tabbed page background color still appears different from original color.
Please find below screenshot for reference.
duplicate #6298
The workaround for the duplicate only affects the actual navbar and does not affect the top tab bar which the shell creates
#6298 only works for the navigationbar.
I managed to fix it by creating a custom AppShellRenderer
c#
using System;
using YourApp;
using YourApp.iOS.Renderers;
using UIKit;
using Xamarin.Forms;
using Xamarin.Forms.Platform.iOS;
[assembly: ExportRenderer(typeof(AppShell), typeof(MyShellRenderer))]
namespace YourApp.iOS.Renderers
{
public class TabbarAppearanceTracker : ShellTabBarAppearanceTracker
{
public override void SetAppearance(UITabBarController controller, ShellAppearance appearance)
{
controller.TabBar.Translucent = false;
base.SetAppearance(controller, appearance);
}
}
public class MyShellRenderer:ShellRenderer
{
protected override IShellTabBarAppearanceTracker CreateTabBarAppearanceTracker()
{
return new TabbarAppearanceTracker();
}
}
}
@samhouts I still have this issue in iOS using xamarin forms 4.6 - is this expected and going to be in a future release or should I raise another issue?
Most helpful comment
@samhouts I still have this issue in iOS using xamarin forms 4.6 - is this expected and going to be in a future release or should I raise another issue?