dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.28k stars 1.76k forks source link

Shell ToolbarItems not shown in iOS App #14802

Open 573F4N077 opened 1 year ago

573F4N077 commented 1 year ago

Description

A ToolbarItem added in the AppShell.xaml is not shown under iOS:

<?xml version="1.0" encoding="UTF-8" ?>
<Shell
    x:Class="Test_Project_Template.AppShell"
    xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    xmlns:local="clr-namespace:Test_Project_Template"
    Shell.FlyoutBehavior="Disabled">

    <!-- This ToolbarItem is not shown-->
    <Shell.ToolbarItems>
        <ToolbarItem Text="Test"></ToolbarItem>
    </Shell.ToolbarItems>

    <ShellContent
        Title="Home"
        ContentTemplate="{DataTemplate local:MainPage}"
        Route="MainPage" />

</Shell>

Steps to Reproduce

  1. Create a new MAUI Project in Visual Studio
  2. Add a ToolbarItem in the Shell
  3. Build the app and deploy it to the end device

Link to public reproduction project repository

https://github.com/573F4N077/Shell.TitleBarItems

Version with bug

7.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

iOS 16

Did you find any workaround?

It might be possible to create a TitleView with custom buttons. But here I found other problems (like binding the title...)

Instead of having global ToolbarItems defined in the Shell it is be possible to add a ToolbarItem in every single Page.

Relevant log output

No response

XamlTest commented 1 year ago

Verified this on Visual Studio Enterprise 17.7.0 Preview 2.0. Repro on iOS 16.4, not repro on Android 13.0-API33 with below Project: Test Project Template.zip

image

image

asi-evin commented 1 year ago

Interested in this as well, especially since I ran into an issue where toolbar item from an inherited page click event doesn't fire.

tenneyb commented 1 year ago

ditto running into same issue

samhouts commented 1 year ago

Duplicate of #7328

asi-evin commented 1 year ago

@samhouts This is NOT a duplicate. This involves having a toolbar item on the SHELL. Their issue is about a ToolbarItem on a PAGE (despite what the title suggests, as their sample has it on the page).

samhouts commented 1 year ago

@asi-evin Thank you for letting me know! I've reopened this one.

trojak3d commented 1 year ago

Is there any updates on this?

deviprasad987 commented 11 months ago

I am also facing the same issue, any update on this issue.

willcorum commented 9 months ago

@samhouts Any updates?

williambohrmann3 commented 8 months ago

able to reproduce this myself

PureWeen commented 7 months ago

If you specify the Toolbaritems on the ContentPage vs the Shell does that work?

I think this might be related to some behavior we added in android for MAUI and iOS didn't keep pace.

williambohrmann3 commented 7 months ago

@PureWeen toolbar items are visible on content page on iOS. However this isn't a great for our iOS app due to https://github.com/dotnet/maui/issues/20703

VishalSingh-RBW commented 2 months ago

Is any one know that how to fix that issue of shell.ToolBarItems text and Icon showing in IOS problem.

tonyhug commented 1 month ago

I am also having this issue

gianox commented 2 days ago

I have this issue as well