在选项卡页面选项卡内的页面之间导航,但不会丢失选项卡页面选项卡

Navigate between pages inside tabbed page tab, but without losing the tab page tabs

我正在为 iOS 和 Android(跨平台)开发 Xamarin.Forms 应用程序

我正在使用底部有 5 个选项卡的选项卡式页面(来自选项卡式页面的自定义渲染)

我的问题是,当我将另一个页面推到标签页顶部时,底部的标签消失了。

有没有办法在推送新页面时保持标签可见?

下面xaml代码和照片:

<xf:BottomBarPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="qfix.Views.mPage"
             xmlns:local="clr-namespace:qfix.Behaviors"
             xmlns:pg="clr-namespace:qfix.Views"
             xmlns:controls="clr-namespace:qfix.CustomRenders;assembly=qfix"
             xmlns:xf="clr-namespace:BottomBar.XamarinForms;assembly=BottomBar.XamarinForms"
                  >
    <ContentPage Title="Home" IconImageSource="home.png"  BackgroundImageSource="background.jpg" />
    <ContentPage Title="Category" IconImageSource="category.jpg"   BackgroundImageSource="background.jpg">
        <ContentPage.Content>
            <pg:categories/>
        </ContentPage.Content>
        
    </ContentPage>
    <ContentPage Title="Request" IconImageSource="plus.png" BackgroundImageSource="background.jpg" >
        <StackLayout Spacing="40" Padding="25">
            <Image Source="logo.png" Aspect="AspectFit" HeightRequest="100"></Image>
            <local:DateTimePicker2></local:DateTimePicker2>
            <StackLayout Spacing="10">
                <Label Text="שם היישוב בו נדרש השירות:" VerticalOptions="End" FontSize="Medium"/>
                <controls:EntryAddress TextColor="Black" WidthRequest="300" x:Name="Address"  PlaceholderText="כתובת" BorderWidth="10"  BorderColor="CadetBlue"></controls:EntryAddress>
            </StackLayout >
            <StackLayout Spacing="10">
                <Label Text="מתי ניתן להתקשר אליך?" VerticalOptions="End" FontSize="Medium"/>
                <controls:MyPicker x:Name="Time_picker" Title="עכשוי"   SelectedItem="Phone_List_ItemSelected" BorderColor="CadetBlue" BorderWidth="10"  >
                    <controls:MyPicker.ItemsSource >
                        <x:Array Type="{x:Type x:String}">
                            <x:String>בעוד שעה</x:String>
                            <x:String>מחר בבוקר-8:00</x:String>
                            <x:String>מחר בבוקר-9:00</x:String>
                            <x:String>מחר אח"צ-13:00</x:String>
                            <x:String>מחר אח"צ-14:00</x:String>
                            <x:String>מחר בערב-20:00</x:String>
                            <x:String>מחר בערב-21:00</x:String>
                            
                        </x:Array>
                    </controls:MyPicker.ItemsSource>
                </controls:MyPicker>
            </StackLayout>
 
            <StackLayout Spacing="10">
                <Label Text="מהו סוג העבודה הנדרשת?" VerticalOptions="End" FontSize="Medium"/>
                <controls:MyEntry  x:Name="kindOfWork" Placeholder="סוג העבודה"  FontSize="20" BorderColor="CadetBlue"  BorderWidth="10"></controls:MyEntry>
            </StackLayout>
            <StackLayout BackgroundColor="#a2D5C6" Opacity="0.3" VerticalOptions="EndAndExpand">
                <Button Text="הגש בקשה"    BorderColor="CadetBlue" BackgroundColor="LightSkyBlue" Clicked="Button_Clicked"  TextColor="Black" FontSize="Large"  ></Button>
            </StackLayout>
        </StackLayout>
    </ContentPage>
    <ContentPage Title="Profile" IconImageSource="profile.png" BackgroundImageSource="background.jpg"/>
    <ContentPage Title="settings" IconImageSource="setting.png" BackgroundImageSource="background.jpg"/>
    
</xf:BottomBarPage>

here is the page within the tab, there is a list view with 2 photos, upon clocking it moves to other page ( photo below after this one)

achived this image by doing "await Navigation.PushModalAsync(new StartupPage());"

1.You 应该用 NavigationPage 扭曲你的 ContentPage,比如:

<NavigationPage Title="Home">
    <x:Arguments>
        <ContentPage Title="Home" IconImageSource="home.png"  BackgroundImageSource="background.jpg" />
    </x:Arguments>
</NavigationPage>

<NavigationPage Title="Home">
    <x:Arguments>
        <ContentPage Title="Category" IconImageSource="category.jpg"   BackgroundImageSource="background.jpg">
            <ContentPage.Content>
                <pg:categories/>
            </ContentPage.Content>
        </ContentPage>
    </x:Arguments>
</NavigationPage>
  1. 您应该使用 await Navigation.PushAsync(new StartupPage()); 而不是 Navigation.PushModalAsync

Modal页面与推送页面不同