Modal Popup not showing Navigation Bar

JassimRahmaJassimRahma USMember ✭✭✭✭


Referring to this thread:

when I changed from:

Navigation.PushModalAsync(new NavigationPage(new Signin())
    BarBackgroundColor = Color.White,
    BarTextColor = Color.Black


await Navigation.PushModalAsync(new Signin());

now the popup is not showing the title bar

How can I fix this please?


Best Answer


  • AsurAsur USMember ✭✭✭

    Modal pages are not traditional Navigation pages as they can't have a back button so you can not set a navigation bar in modal pages as that goes against it's purpose .
    Modal pages are not supposed to be backed from unless it's purpose is solved.
    So either use simple navigation with pushAsync or if you want title in modal pages create a view yourself .

  • JassimRahmaJassimRahma USMember ✭✭✭✭

    I tried the TitleView but nothing is shown either. Below is my XAML and I am showing the page using:

    Navigation.PushModalAsync(new Signin());

    My contractor:

    public Signin ()
        InitializeComponent ();

    My XAML:

    <?xml version="1.0" encoding="utf-8" ?>
    <ContentPage xmlns=""
            <StackLayout Orientation="Horizontal">
                <Label Text="Sign in" HorizontalOptions="Start" VerticalOptions="CenterAndExpand" />
                <Image x:Name="ImageSigninTitleBarClose" Source="close.png" HorizontalOptions="End" VerticalOptions="CenterAndExpand">
                        <TapGestureRecognizer Tapped="ImageSigninTitleBarCloseTapped" NumberOfTapsRequired="1" />
                    <SyncfusionInputLayout:SfTextInputLayout Hint="Email Address" ContainerType="Outlined">
                        <Entry x:Name="TextBoxSigninEmailAddress" Keyboard="Email" HorizontalTextAlignment="Center" />
                    <SyncfusionInputLayout:SfTextInputLayout Hint="Password" EnablePasswordVisibilityToggle="True" ContainerType="Outlined">
                        <Entry x:Name="TextBoxSigninPassword" IsPassword="True" HorizontalTextAlignment="Center" />
                    <SyncfusionBusyIndicator:SfBusyIndicator x:Name="BusyIndicatorSignin" AnimationType="SingleCircle" IsBusy="True" IsVisible="False" WidthRequest="40" HeightRequest="40" ViewBoxWidth="30" ViewBoxHeight="30" TextColor="Blue" />
                    <Button x:Name="ButtonSignin"  Text="Sign in" Clicked="ButtonSignin_Clicked" />
                    <Button x:Name="ButtonForgotPassword" Text="Forgot Password" />
                    <Button x:Name="ButtonGoToSignup"  Text="New User?" Clicked="ButtonGoToSignup_Clicked" />
  • JohnHardmanJohnHardman GBUniversity mod

    @JassimRahma said:
    I tried the TitleView but nothing is shown either

    It's not the Navigation.TitleView that you use. Move the StackLayout that you currently have in the Navigation.TitleView to inside the StackLayout that you have in the ScrollView.

  • JassimRahmaJassimRahma USMember ✭✭✭✭

    but this means it's just a normal content within the ContentPage.

    then what's the purpose of TitleView if I cannot use it?

  • JoeMankeJoeManke USMember ✭✭✭✭✭

    The TitleView goes in the TitleBar and you are doing everything in your power to not show the TitleBar. Why are you surprised?

Sign In or Register to comment.