I am facing an issue with the TabView from the XamarinCommunityToolkit.
There is a MainPage with two tabs "A" and "B", "A" showing some content, "B" serving as navigation to another ContentPage "DetailsPage". Additionally, the MainPage has set NavigationPage.HasNavigationBar="false" and should not display any navigation bar.
On launch, the navigation bar is not visible as expected. When clicking Tab "B" and then the back button on the "DetailsPage", the TabView seems to change its height and takes additional space.
Here is basically all of the code:
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:views="http://xamarin.com/schemas/2020/toolkit"
x:Class="App1.MainPage"
NavigationPage.HasNavigationBar="false"
>
<StackLayout>
<views:TabView
TabStripPlacement="Bottom"
BackgroundColor="Gold"
TabStripHeight="60"
TabStripBackgroundColor="ForestGreen"
>
<views:TabViewItem
Text="A">
<Grid BackgroundColor="Cyan"/>
</views:TabViewItem>
<views:TabViewItem
Text="B"
TabTapped="ShowDetailsPage">
</views:TabViewItem>
</views:TabView>
</StackLayout>
</ContentPage>
In the code-behind file App.xaml.cs one additional line is added in order to enable navigating to the "DetailsPage":
MainPage = new NavigationPage(new MainPage());
Here is the result with the undesired "golden bar": Undesired change in height of TabView
I already tried to:
Any help or hints are highly appreciated.
EDIT/ADDITION: The hint towards wrong layout of the tabview as mentioned by Alexander May lets us narrow down the issue even further.
The issue exists also when navigating to a details page via any navigation object such as a button within the content of the TabViewItem.
The sample can thus be further reduced to one single tab:
<StackLayout>
<views:TabView
TabStripPlacement="Bottom"
BackgroundColor="Gold"
TabStripHeight="60"
TabStripBackgroundColor="ForestGreen"
>
<views:TabViewItem
Text="A">
<Grid BackgroundColor="Cyan">
<Button Clicked="ShowDetailsPage" Text="Click Me" BackgroundColor="LightPink"></Button>
</Grid>
</views:TabViewItem>
</views:TabView>
</StackLayout>
There is an open bug for this on the Community Toolkit site: https://github.com/xamarin/XamarinCommunityToolkit/issues/625