-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shell: Top tabs are not displayed correctly (wrong color on Android, invisible on Windows) #6558
Comments
@rachelkang are the tab colors here on Android from our |
@PureWeen yes - dotnet purple for the text color maui/src/Templates/src/templates/maui-mobile/Resources/Styles.xaml Lines 339 to 350 in 1b05e12
|
I've experienced this in my app, and I found a workaround: <FlyoutItem Title="{Binding AlertSettings.Title}"
Icon="{AppThemeBinding Light=edit_notifications.png, Dark=edit_notifications_dark.png}">
<Tab Title="{x:Static strings:Resources.ShellAlertSettings}" >
<ShellContent Title="{Binding AlertSettings.Title}"
Icon="{AppThemeBinding Light=edit_notifications.png, Dark=edit_notifications_dark.png}"
ContentTemplate="{DataTemplate alerts:AlertSettingsPageMobile}"
/>
</Tab>
<Tab Title="Retailer Options">
<ShellContent Title="Retailer Options"
ContentTemplate="{DataTemplate alerts:RetailerOptionsPage}" />
</Tab>
<Tab Title="Active Notifications">
<ShellContent Title="Active Notifications"
ContentTemplate="{DataTemplate alerts:ActiveNotificationsPage}"/>
</Tab>
</FlyoutItem> So instead of using one tab, you use multiple on Windows. When you use tab with multiple shell contents inside of it, it creates a tab, but with a dropdown for selecting a page instead. The only time I saw this break was when a single tab would have multiple shell contents inside but a single tab. Having multiple tabs, with multiple shell contents worked, where each tab would then contain a drop down allowing the user to select multiple pages. |
The WinUI quirks should be fixed by this PR for RC3 |
Will they support multiple contents per tab? That was kind of nice actually. Something that was not there AFAIK in Preview 14. Having |
@emorell96 I don't quite follow your question. If you have <Tab title="top tab">
<ShellContent title="sub tab" />
<ShellContent title="sub tab2" /> Top Tab will show up on the tab bar and then the sub tabs will be children of that tab. If you have <TabBar title="top tab"> //Or FLyoutItem
<ShellContent title="sub tab" />
<ShellContent title="sub tab2" /> Then those two tabs will just show up as two top level tabs. |
@PureWeen so on RC1 I could do this: <FlyoutItem Title="{Binding AlertSettings.Title}"
Icon="{AppThemeBinding Light=edit_notifications.png, Dark=edit_notifications_dark.png}">
<Tab Title="{x:Static strings:Resources.ShellAlertSettings}" >
<ShellContent Title="{Binding AlertSettings.Title}"
Icon="{AppThemeBinding Light=edit_notifications.png, Dark=edit_notifications_dark.png}"
ContentTemplate="{DataTemplate alerts:AlertSettingsPageMobile}"
/>
<ShellContent Title="Retailer Options"
ContentTemplate="{DataTemplate alerts:RetailerOptionsPage}" />
<ShellContent Title="Active Notifications"
ContentTemplate="{DataTemplate alerts:ActiveNotificationsPage}"/>
</Tab>
<Tab Title="Retailer Options">
<ShellContent Title="Retailer Options"
ContentTemplate="{DataTemplate alerts:RetailerOptionsPage}" />
</Tab>
<Tab Title="Active Notifications">
<ShellContent Title="Active Notifications"
ContentTemplate="{DataTemplate alerts:ActiveNotificationsPage}"/>
</Tab>
</FlyoutItem> The code on Windows would create three tabs inside the page. And the first tab would have a dropdown which would contain the shellcontents. Is that still a thing in RC2 and RC3? I cannot try it because my application no longer builds on Windows thanks to this issue: #5953 |
@emorell96 yea! So the XAML you gave me will produce the same output for RC3. |
@emorell96 scratch that. Changing how it works now would make it confusingly different from Android/iOS So you should see the same experience once RC3 merges |
The issue has not been fixed in RC3 for Windows. Instead top tabs, something like a context menu is rendered on Windows (Android renders top tabs correctly). This is a breaking behavior compared to Xamarin.Forms. If I enclose each ShellContent into a separate Tab, top tabs are rendered on Windows, but bottom tabs are rendered on Android. The behavior is not consistent for both platforms. Finally, I have tried to enclose ShellContents into a TabBar but this does not work with a flyout menu. Is there currently a way how to display a flyout menu and top tabs at the same time on Windows? This is not a problem in Xamarin.Forms but it seems impossible in MAUI RC3. I do not want bottom tabs because they are very unnatural for Windows (I do not know any other Windows app that would use bottom tabs). They make sense for Android where the users can select them easier by their thumbs. |
Description
Top tabs are unusable when the following structure is used in the shell:
This should add two entries into the flyout menu and the second one should be divided into two tabs that should be displayed on the upper part of the page.
This is displayed correctly in Xamarin.Forms. The tabs are however unusable in MAUI:
Screenshots:

Tabs in MAUI on Windows (tabs are not displayed at all):
Tabs in MAUI on Android (only the selected tab is visible, the other tab is transparent):

Tabs in Xamarin.Form on UWP (tabs displayed correctly):

Tabs in Xamarin.Form on Android (tabs displayed correctly):

Steps to Reproduce
Version with bug
Release Candidate 2 (current)
Last version that worked well
Unknown/Other
Affected platforms
Android, Windows, I was not able test on other platforms
Affected platform versions
Android 10 emulator, tested on Window 10; the target versions for Android and Windows are the default ones from VS 17.2 preview 5
Did you find any workaround?
No
Relevant log output
No response
The text was updated successfully, but these errors were encountered: