Commit 971e326
Fix iOS 26 TitleView covering content in Shell and NavigationPage (#32341)
* Initial plan
* Implement improved fix for iOS 26 TitleView covering content issue
- Added CreateTitleViewContainer helper method to reduce code duplication
- Improved iOS 26+ detection with proper fallback when navigation bar frame unavailable
- Set frame origin to (0,0) instead of preserving potentially uninitialized X/Y values
- Added comprehensive XML documentation explaining iOS 26 workaround
- Added test case and UI test for Issue32287
This implementation addresses the critical issues identified in PR #32337 review:
- Eliminates silent failure by providing fallback to standard constructor
- Clarifies frame positioning logic with explicit (0,0) origin
- Reduces code duplication through helper method
- Adds proper documentation for maintainability
Co-authored-by: PureWeen <[email protected]>
* Apply iOS 26 TitleView fix to NavigationPage
Extended the iOS 26+ TitleView fix to NavigationPage in addition to Shell:
1. Added CreateTitleViewContainer helper method to centralize container creation
2. Added Container constructor overload accepting navigation bar frame for iOS 26+
3. Refactored Container initialization to use InitializeContainer method
4. Updated ToolbarHeight to use actual navigation bar height when available
5. Eliminated hardcoded 44pt height assumption for iOS 26+
This ensures both Shell and NavigationPage TitleView implementations handle iOS 26 layout changes consistently, preventing TitleView from covering page content.
Co-authored-by: PureWeen <[email protected]>
* Enhance Issue32287 test with rotation and dynamic content size changes
Extended the Issue32287 test based on review feedback:
1. Added rotation test to verify TitleView behavior in landscape mode
2. Added dynamic font size change tests to verify container tracks nav bar changes
3. Added buttons to increase/decrease TitleView font size
4. Added x:Name to TitleLabel for programmatic access
5. Created placeholder snapshot image for test validation
6. Wrapped rotation tests with TEST_FAILS_ON_WINDOWS && TEST_FAILS_ON_CATALYST
Tests now comprehensively verify that TitleView container correctly tracks
navigation bar frame changes without covering content in all scenarios.
Co-authored-by: PureWeen <[email protected]>
* - update tests
* Add NavigationPage equivalent tests for Issue32287
Created comprehensive NavigationPage tests mirroring the Shell tests:
1. Issue32287NavigationPage.xaml - NavigationPage with custom TitleView
2. Issue32287NavigationPage.xaml.cs - Code-behind with font size controls
3. Issue32287NavigationPage.cs - UI tests matching Shell test scenarios:
- Basic test verifying TitleView doesn't cover content
- Dynamic content size change test
- Landscape rotation test (iOS/Android only)
4. Created placeholder snapshot image for visual validation
Tests verify that the NavigationPage Container fix handles iOS 26+ layout
changes consistently with Shell, preventing TitleView from covering content.
Co-authored-by: PureWeen <[email protected]>
* Fix NavigationPage XAML structure and add platform-specific comments
Fixed XAML parsing error and addressed PR review feedback:
1. Changed Issue32287NavigationPage from NavigationPage to ContentPage
- NavigationPage cannot have content directly set in XAML
- NavigationPage.TitleView is an attached property set on ContentPage
- Updated base class from NavigationPage to ContentPage
2. Added explanatory comments for platform-specific conditionals
- Documented that rotation tests only work on iOS/Android
- Explained SetOrientationLandscape/Portrait not supported on Windows/Catalyst
- Applied to both Issue32287 and Issue32287NavigationPage test files
Fixes XAML error: "Cannot set the content of NavigationPage as it doesn't
have a ContentPropertyAttribute"
Co-authored-by: PureWeen <[email protected]>
* - fix navigation page
* Delete src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/CustomTitleViewDoesNotCoverContent.png
* Delete src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/Issue32287NavigationPageCustomTitleViewDoesNotCoverContent.png
* - fix tests and add suggested fix
* Remove all test files from PR
Deleted all Issue32287 test files as requested:
- Issue32287.xaml and Issue32287.xaml.cs (Shell tests)
- Issue32287NavigationPage.xaml and Issue32287NavigationPage.xaml.cs (NavigationPage tests)
- Issue32287.cs and Issue32287NavigationPage.cs (UI test implementations)
The PR now contains only the iOS 26 TitleView fix implementation without test coverage.
Co-authored-by: PureWeen <[email protected]>
---------
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: PureWeen <[email protected]>
Co-authored-by: Shane Neuville <[email protected]>1 parent 0d0d565 commit 971e326
File tree
2 files changed
+100
-4
lines changed- src/Controls/src/Core/Compatibility/Handlers
- Shell/iOS
2 files changed
+100
-4
lines changedLines changed: 54 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1664 | 1664 | | |
1665 | 1665 | | |
1666 | 1666 | | |
1667 | | - | |
| 1667 | + | |
1668 | 1668 | | |
1669 | 1669 | | |
1670 | 1670 | | |
1671 | 1671 | | |
1672 | 1672 | | |
1673 | 1673 | | |
| 1674 | + | |
| 1675 | + | |
| 1676 | + | |
| 1677 | + | |
| 1678 | + | |
| 1679 | + | |
| 1680 | + | |
| 1681 | + | |
| 1682 | + | |
| 1683 | + | |
| 1684 | + | |
| 1685 | + | |
| 1686 | + | |
| 1687 | + | |
| 1688 | + | |
| 1689 | + | |
| 1690 | + | |
| 1691 | + | |
| 1692 | + | |
| 1693 | + | |
| 1694 | + | |
1674 | 1695 | | |
1675 | 1696 | | |
1676 | 1697 | | |
| |||
2083 | 2104 | | |
2084 | 2105 | | |
2085 | 2106 | | |
| 2107 | + | |
2086 | 2108 | | |
2087 | 2109 | | |
2088 | 2110 | | |
2089 | 2111 | | |
2090 | 2112 | | |
2091 | 2113 | | |
2092 | | - | |
| 2114 | + | |
| 2115 | + | |
| 2116 | + | |
| 2117 | + | |
| 2118 | + | |
| 2119 | + | |
| 2120 | + | |
| 2121 | + | |
| 2122 | + | |
| 2123 | + | |
| 2124 | + | |
| 2125 | + | |
| 2126 | + | |
| 2127 | + | |
| 2128 | + | |
| 2129 | + | |
| 2130 | + | |
| 2131 | + | |
| 2132 | + | |
| 2133 | + | |
| 2134 | + | |
| 2135 | + | |
2093 | 2136 | | |
2094 | 2137 | | |
2095 | 2138 | | |
| |||
2106 | 2149 | | |
2107 | 2150 | | |
2108 | 2151 | | |
| 2152 | + | |
| 2153 | + | |
2109 | 2154 | | |
2110 | 2155 | | |
2111 | 2156 | | |
| |||
2170 | 2215 | | |
2171 | 2216 | | |
2172 | 2217 | | |
| 2218 | + | |
| 2219 | + | |
| 2220 | + | |
| 2221 | + | |
2173 | 2222 | | |
2174 | 2223 | | |
2175 | 2224 | | |
| 2225 | + | |
| 2226 | + | |
| 2227 | + | |
2176 | 2228 | | |
2177 | 2229 | | |
2178 | 2230 | | |
| |||
Lines changed: 46 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
309 | | - | |
| 309 | + | |
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
| |||
316 | 316 | | |
317 | 317 | | |
318 | 318 | | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
319 | 340 | | |
320 | 341 | | |
321 | 342 | | |
| |||
684 | 705 | | |
685 | 706 | | |
686 | 707 | | |
687 | | - | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
688 | 717 | | |
689 | 718 | | |
690 | 719 | | |
691 | 720 | | |
692 | 721 | | |
| 722 | + | |
693 | 723 | | |
694 | 724 | | |
695 | 725 | | |
696 | 726 | | |
697 | 727 | | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
698 | 742 | | |
699 | 743 | | |
700 | 744 | | |
| |||
0 commit comments