xamarin.forms.ios navigationbar renderer change height

2.3k Views Asked by At

So I have looked everywhere for an answer to what seems like a simple problem. I have a xamarin.forms app, and when I have been viewing it next to other apps like Facebook and Google+, I have realized the NavigationBar height was at least 20% taller. This taller NavigationBar takes up to much space, but also stretches my TabBarItem icons. My other changes like TintColor and BarTintColor work great. I just want height to be smaller. I will include an image to show what I am talking about as well.

enter image description here

public NavigationPageRenderer_iOS()
    {
    }

    public override UIStatusBarStyle PreferredStatusBarStyle()
    {
        return UIStatusBarStyle.Default;
    }

    public override void ViewDidLoad()
    {
        base.ViewDidLoad();

        NavigationBar.TintColor = UIColor.White;
        NavigationBar.BarTintColor = UIColor.FromRGB (36,161,175);


    }
1

There are 1 best solutions below

0
On

Given that the iOS UINavigationBar has no exposed properties to adjust the height this is not going to be possible natively :

https://developer.apple.com/library/ios/documentation/UIKit/Reference/UINavigationBar_Class/

That been said, you could roll your own navigation bar to retain ultimate control. There is also the option of hiding the statusBar to give the impression of a reduced height.