priya_d
priya_d

Reputation: 403

Remove Navigation Bar Shadow/Line in Xamarin.forms

How to Remove Navigation Bar Shadow and Line of content page in Xamarin.forms. Is it possible to do this without rendering.

Upvotes: 1

Views: 1864

Answers (2)

Nithin joy
Nithin joy

Reputation: 336

Add this render class inside you xamarin ios project

[assembly: ExportRenderer(typeof(NavigationPage), typeof(CustomNavigationRenderer))]
namespace YOUR_IOS_NAMESPACE
{
    public class CustomNavigationRenderer : NavigationRenderer
    {
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            NavigationBar.ShadowImage = new UIImage(); 
        }
    }
}

Upvotes: 1

Ian Vink
Ian Vink

Reputation: 68810

For just Xamarin Forms, iOS. Add this to your AppDelegate

 UINavigationBar.Appearance.ShadowImage = new UIImage(); //No line under the navigation

Upvotes: 5

Related Questions