I did it in the following way:
[assembly: ExportRenderer(typeof(NavigationPage), typeof(ExtendedNavigationRenderer))]
namespace Sample.iOS
{
public class ExtendedNavigationRenderer : NavigationRenderer
{
UIToolbar _secondaryToolbar;
public override void ViewDidLoad()
{
base.ViewDidLoad();
//_secondaryToolbar = View.Subviews.OfType<UIToolbar>().FirstOrDefault(v => v.GetType() != typeof(UIToolbar));
_secondaryToolbar = View.Subviews.OfType<UIToolbar>().FirstOrDefault();
if (_secondaryToolbar != null)
_secondaryToolbar.BarTintColor = this.NavigationBar.BarTintColor;
}
public override void ViewDidLayoutSubviews()
{
base.ViewDidLayoutSubviews();
if (_secondaryToolbar != null && _secondaryToolbar.Items != null)
{
foreach (UIBarButtonItem item in _secondaryToolbar.Items)
{
var label = item.CustomView.Subviews.OfType<UILabel>().FirstOrDefault();
if (label != null)
{
label.TextColor = UINavigationBar.Appearance.TitleTextAttributes.ForegroundColor;
//label.Font = label.Font.WithSize(12f);
}
}
}
}
(TintColor approach brings the real color that is slightly different from primary NavigationBar, but NavigationBar.BackgroundColor is null)
Toolbar
, do you mean the toolbar in custom rendererNavigationRenderer
, and also could you attach the image to describe your issue, I think it will be more intuitive – ColeX - MSFT