Closed jamesnet214 closed 2 years ago
I think it's the same problem I reported here https://github.com/dotnet/maui/issues/8974 Try launching the app after moveing App/AppShell.xaml to the same directory as your Page's. This will probably introduce you to another bug of Tab Icon being out of proportion and all over your screen if you use .png tho :D
for me the problem is not that TabBar control does not work (even if App/AppShell is not in Pages folder), but the problem with ShellContent.Icon is real. If you run Microsoft Learn Astronomy sample you'll see images not scaling. I've tried to add :
<MauiImage Update="Resources\Images\comet.png" BaseSize="225,225" />
to the project file but it didn't work as well.
The source code relative to above comment: https://github.com/MicrosoftDocs/mslearn-dotnetmaui-create-multi-page-apps
I've just been looking into this more - I've reproduced it by:
When using SVG icons, the simulator turns black and the app basically crashes. When using PNG icons, the app shows up fine.
<?xml version="1.0" encoding="UTF-8" ?>
<Shell
x:Class="ImageRepro.AppShell"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:ImageRepro"
Shell.FlyoutBehavior="Disabled">
<TabBar>
<ShellContent Title="Page 1" Icon="home.svg"
ContentTemplate="{DataTemplate local:MainPage}" />
<ShellContent Title="Page 2" Icon="camera.svg"
ContentTemplate="{DataTemplate local:MainPage}" />
</TabBar>
</Shell>
I had this exact problem as well and it seems that removing the .svg
icon from the tab bar fixes the problem. (You have to clean the solution as well after making that change)
Odd.
After more testing, turns out you can keep the icon - just remove the .svg
extension from the icon.
<Tab Title="About" Icon="information">
<ShellContent ContentTemplate="{DataTemplate pages:AboutPage}"/>
</Tab>
Description
Images from both apps are build results from the same source.
Android shows TabBar control, but I can't see it on the iPhone.
I just wrote this much code.
Full source code (GitHub)
Steps to Reproduce
IOS
Version with bug
6.0.400
Last version that worked well
Unknown/Other
Affected platforms
iOS
Affected platform versions
IOS all version
Did you find any workaround?
No response
Relevant log output
No response