Repository navigation
Implement iOS/macOS secondary ToolbarItems - #28185
Merged
Merged
Conversation
jfversluis
marked this pull request as draft
March 5, 2025 14:13
jsuarezruiz
reviewed
Mar 6, 2025
jfversluis
force-pushed
the
ios-secondary-toolbaritem
branch
from
March 7, 2025 13:40
52c36c7 to
3b21fc6
Compare
Contributor
|
/rebase |
github-actions
Bot
force-pushed
the
ios-secondary-toolbaritem
branch
from
March 28, 2025 09:41
3b21fc6 to
74f465f
Compare
jfversluis
force-pushed
the
ios-secondary-toolbaritem
branch
from
June 17, 2025 08:03
74f465f to
45e7252
Compare
jfversluis
marked this pull request as ready for review
June 17, 2025 10:39
jfversluis
requested review from
Copilot,
jsuarezruiz and
rmarinho
and removed request for
PureWeen and
rmarinho
June 17, 2025 10:39
rmarinho
reviewed
Jun 23, 2025
|
@jfversluis Imho here only |
|
@lucacivale I've also interested in this PR feature but on .NET 9. Can you share your solution or is it private? |
jfversluis
force-pushed
the
ios-secondary-toolbaritem
branch
from
July 3, 2025 15:10
725fec1 to
5b3faa0
Compare
PureWeen
approved these changes
Jul 3, 2025
This was referenced Jul 17, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Change
Uses a more modern pattern for iOS to show secondary toolbar items. This PR detects toolbar items that have the
Orderproperty set toSecondaryand displays them in a popover menu. The icon is the system icon from iOS, we might consider letting the people customize that, although I'm not 100% sure how. The current implementation follows the iOS UI guidelines: https://developer.apple.com/design/human-interface-guidelines/pull-down-buttonsThe secondary menu is always shown on the far right (or left when RTL is on) and takes into account
Priorityto order the items.This PR:
NavigationRendererso people can provide their own image for the secondary toolbar item (the root item), defaults to what iOS recommends (UIImage.GetSystemImage("ellipsis.circle"))Note that this uses APIs that are only available on iOS 13+, I think that is the minimum supported version for .NET MAUI on .NET 10 anyway?
We could consider keeping this old way for iOS < 13 and/or add a flag that will let people revert to the old behavior.
Be aware that when enabled changes for one of the secondary items, the menu will be closed. The menu items in there are immutable, so when that happens, the whole menu is rebuilt which causes the menu to close when its opened.
Issues Fixed
Fixes #815
Preview
iOS
Simulator.Screen.Recording.-.iPhone.16.Pro.-.2025-03-05.at.14.37.15.mp4
macOS