0
votes

Using Xamarin Forms 2.5.0.122203, I want to achieve to add an image that is half over navigation bar and another half in the page like this image

screenshot of result

I tried Negative margin and it only worked on UWP. Unfortunately, iOS and Android cut image. I was thinking of creating a custom navigation bar but the thing is UWP has this bug that doesn't hide native Navigation right.

Any solution?

Thank you

1
You can try using github.com/stormlion227/SNavigation.Forms. Not sure if it will work in your caseAbsoluteSith
You can use 2 images half on Navigationbar & half on pageR15
@AbsoluteSith Please post it as an answer, thank you for your help it workedElias Nawfal
Also, thank you @PriyankaAgrawal I made it half on NavigationBar & half on page great tipElias Nawfal
@EliasNawfal Could you post your solution ? I tried the SNavigation to do the same widthout successdoxsi

1 Answers

0
votes

I ended up Copying SNavigation.Forms to my projects. After following their documentation.

In the Page I override

protected override void OnBindingContextChanged()
    {
        if (BindingContext == null)
        {
            return;
        }
        base.OnBindingContextChanged();
        SNavigationPage.SetNavContent(this, new LogoHeader()
        {
            BindingContext = BindingContext,
        });
    }

The LogoHeader is the intended layout to be postioned in the Navigation (Better use a Grid)

Visually I have one Navigation Header but technically it is cut in half. It took a lot of time to get the perfect result because you have to remove all navigation shadows from Android and iOS but it is a reliable solution