Repository navigation
docs(tabbar): put the TabBar in the iOS vertical bar - #1704
Merged
Merged
Conversation
Contributor
|
This pull request is merged. |
Xiaoy312
approved these changes
Nov 19, 2026
Xiaoy312
left a comment
Contributor
There was a problem hiding this comment.
Approving: docs and sample only, and the iOS code compiles out in CI. Findings from review, none blocking:
- Stale insets (
M3MaterialIOSVerticalBarSampleNestedPage.xaml.cs,OnVisibleBoundsChanged): placement readsSafeArea.WindowInsetsinsideVisibleBoundsChanged, andSafeAreamay not have updated yet. On rotation or at the launch transition the strip can end up on the wrong edge or the wrong bar can stay visible. - Wrong scene (
HasVerticalBar()): it uses the first connectedUIWindowScenerather than the one hosting the page, which is wrong in multi-window setups. - Left/right guessing (how-to snippet): the strip side comes from comparing insets, not from
VerticalBarEdge(Leading/Trailing). It breaks under RTL, or when both insets are non-zero. - Magic number: the fixed
Height="240"on the verticalTabBaronly fits exactly four items, and it is duplicated in the sample. GetForCurrentView()inLoaded/Unloaded: this is a legacy per-view API, so unsubscribing can fail or hit a different instance. Capturing the instance in a field would be safer.- Test coverage: all logic is behind
IOS27_1_OR_GREATER, which CI (Xcode 26.1.1) never defines, so it is never compiled there. No runtime tests are added, and the doc and sample XAML/code are duplicated verbatim. - Validation notes (
specs/tabbar-ios-vertical-bar/progress.md): the Duo simulator run used a temporary, uncommitted launch hook, so the shipped navigation path (button to nested page) isn't shown as exercised. The inner screen and a regular iPhone on 27.1 are untested.
Contributor
Author
|
@Xiaoy312 thanks for the review. I checked each point. One was a real bug, now fixed in 3bebf88 (doc) and 8f883a1 (sample).
|
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
GitHub Issue (If applicable): N/A, tracked internally (see below)
PR Type
What kind of change does this PR introduce?
What is the current behavior?
On iOS 27.1, the iPhone Duo cover screen shows a vertical bar: an 84 pt strip that holds the status bar, on the right in portrait and on the left in landscape. Native tab bars move into it as an icon-only vertical bar.
iOS reports the strip as a left or right safe-area inset, and the window width doesn't change. The documented responsive
TabBarrecipe picks a layout from the width, so it keeps the bottomTabBarin both orientations.SafeAreakeeps the items out of the strip, but the strip stays empty. The docs don't say how to use the strip.What is the new behavior?
doc/controls/walkthroughs/TabBar-and-TabBarItem.howto.md:UITraitCollection.VerticalBarEdgeand shows an icon-only verticalTabBarin the strip, sized fromSafeArea.WindowInsets.TabBar'sSelectedIndexto the bottomTabBar's.ApplicationView.VisibleBoundsChanged, which covers the strip appearing after launch, and onXamlRoot.Changed, which covers rotation (on iOS, Uno raisesVisibleBoundsChangedbefore it updates the window size).NavigationBarinsets,{utu:Responsive}andFlowDirection.doc/assets/tabbar-ios-vertical-bar-*.png).doc/controls/TabBarAndTabBarItem.mdlinks to the section from "Responsive TabBar Layout".M3MaterialIOSVerticalBarSampleNestedPage, opened from the "Show iOS Vertical Bar Sample" button on the Material TabBar sample page. It runs the doc code as a full page.specs/tabbar-ios-vertical-bar/progress.mdrecords the measurements, the plan and the validation.The iOS code is guarded by
IOS27_1_OR_GREATER, which is defined only when building with the iOS 27.1 bindings. CI builds with Xcode 26.1.1, so it compiles out there.PR Checklist
Please check if your PR fulfills the following requirements:
Other information
Validation, on the iPhone Duo simulator (Xcode 27.1, iOS 27.1), cover screen:
dotnet new unoapp(Uno.Sdk 7.1, Toolkit 11.0.1, Material, Skia renderer). Builds with no warnings against the iOS 27.1 bindings. TheTabBarsits in the right strip in portrait and the left strip in landscape, selection stays in sync, and the strip appearing after launch is picked up. Rotating landscape → portrait, which the first round missed, is checked too. An iPhone 18 Pro on iOS 27.0 keeps the bottomTabBar.net10.0-desktop(code compiled out) and fornet10.0-ioswith the 27.1 bindings (code compiled in). It ran on the Duo through a temporary launch hook that isn't part of this PR, and matches the doc. TheNavigationBarwithLeft,Top,Rightinsets stays out of the strip.Found along the way:
OperatingSystem.IsIOSVersionAtLeast(27, 1)raises CA1416 onVerticalBarEdge, because the analyzer also treats it as a Mac Catalyst check. The doc and the sample useOperatingSystem.IsOSPlatformVersionAtLeast("ios", 27, 1), which builds clean.Not covered:
RootViewControllerto overridePreferredVerticalBarBehavior.Internal Issue (If applicable): https://github.com/unoplatform/uno-private/issues/2714