[iOS] Shell Back Button Label

See original GitHub issue

Description

When using navigation pages with Shell-based navigation on an iOS .NET MAUI app, the back button label will set itself to the same as the page title if the title is short enough, otherwise it will do the expected behaviours (when page title is longer) and have a label of ‘Back’ (see images below).

I do not believe that this is intended behaviour as that would not make much sense. I should also add that this does not happen on Windows or on an Android emulator (12.0 - API 31), but I was unable to test the behaviour on MacCatalyst.

Steps to Reproduce

  1. Create a new dotnet MAUI project.
  2. Create the MainPage and another page, e.g. DemoPage, and register pages and routes on AppShell.xaml.cs
  3. Insert a button with command Shell.Current.GoToAsync(nameof(DemoPage)); on the MainPage
  4. Run the app on an iOS iPhone 15.5 simulator with Hot Reload enabled.
  5. Navigate to DemoPage
  6. Edit the title parameter in ContentPage there by making it longer and shorter to see the back button’s unexpected behaviors on simulator live.

Alternatively clone this repo (https://github.com/ThatJammyDodger/iOSNav) and run it in iOS simulator, using the buttons to see what happens.

Results: Short Long

Dotnet version: 6.0.400-preview.22301.10

Version with bug

6.0.400 (current)

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

iOS 15.5

Did you find any workaround?

https://github.com/PureWeen/ShanedlerSamples/blob/main/ShanedlerSamples/Library/Workarounds/ShellWorkarounds.iOS.cs Edit: Yes, see comment below

Relevant log output

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:9
  • Comments:25 (10 by maintainers)

github_iconTop GitHub Comments

10reactions
derek-williscommented, Oct 12, 2022

How do these fundamental things get released, app looks and feels unprofessional. Using Shell, there is a big delay in page titles changing too, really bad!

4reactions
3steve3commented, Nov 28, 2022

This is seems like one of those issues that should be fixed by now, but it’s still present in the .Net 7 version.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Net MAUI - Shell Navigation Back Button Title (iOS)
In iOS, it should Back Button text as "Back" otherwise just show the back button. But it shows the page's title text. Update...
Read more >
backButtonTitle | Apple Developer Documentation
Use this property to set the title of the Back button when a view controller's navigationItem is the backItem of the navigation bar,...
Read more >
Overriding Back Button in Xamarin.Forms Shell…
Forms Shell, which lets you override the Navigation Bar Back button, even allowing you to customize the button appearance with an icon or...
Read more >
How to remove text from a navigation bar back button
Click on view controller A's Navigation item · Go to Attributes inspector ( ⌥ – Option + ⌘ - command + 5 or...
Read more >
NavigationPage - .NET MAUI
BackButtonTitle , of type string , represents the text to use for the back button. This is an attached property.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found