3
votes

Is there anyway to allow content to touch the top of the screen while keeping the hamburger icon. In the example below, imagine the blue background was an image, I want the blue to touch the top of the screen and have the hamburger icon overlay over the top: Example 1

I've tried the following but it just changes the colour of the bar:

<Shell 
       BackgroundColor="Transparent">

If there is no way to hide just the bar, is there anyway to hide the bar and the hamburger icon and then add the icon back manually?

EDIT: I tried but it removed the hamburger icon as well. Is there anyway to add the hamburger icon back?:

Shell.NavBarIsVisible="False"

EDIT: Just seen this implentation which is what I need but is there anyway to do this with Xamarin Shell: https://xamgirl.com/transparent-navigation-bar-in-xamarin-forms/

RESOLUTION: This has now been moved to the Xamarin Forms GitHub

1
No, the hamburger is inside the navbar.zaggler
Is there no way with custom rendereres to remove it from the navbar?Ryan Gaudion
Sure read into that... My comment was in response to is there anyway to remove the navigation bar but keep the hamburger icon and there's not.zaggler
I don't think that it is possible to implement it . The style had been set in default in shell .Lucas Zhang

1 Answers

1
votes

Set the style of Shell navigation bar in Resource Dictionary

   <Shell.Resources>
        <ResourceDictionary>
            <Color x:Key="NavigationPrimary">#2196F3</Color>
            <Style x:Key="BaseStyle" TargetType="Element">
                <Setter Property="Shell.BackgroundColor" Value="Transparent" />  // set navigation bar as Transparent
                <Setter Property="Shell.ForegroundColor" Value="Blue" />
                <Setter Property="Shell.TitleColor" Value="Blue" />
                <Setter Property="Shell.DisabledColor" Value="#B4FFFFFF" />
                <Setter Property="Shell.UnselectedColor" Value="#95FFFFFF" />
                <Setter Property="Shell.TabBarBackgroundColor" Value="{StaticResource NavigationPrimary}" />
                <Setter Property="Shell.TabBarForegroundColor" Value="White"/>
                <Setter Property="Shell.TabBarUnselectedColor" Value="#95FFFFFF"/>
                <Setter Property="Shell.TabBarTitleColor" Value="White"/>
            </Style>
            <Style TargetType="TabBar" BasedOn="{StaticResource BaseStyle}" />
        </ResourceDictionary>
    </Shell.Resources>