[Net10] [iOS] Set NavigationBar.Translucent based on NavigationPage BarBackgroundColor transparency#30981
Merged
PureWeen merged 3 commits intodotnet:net10.0from Sep 18, 2025
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR modifies the NavigationPage on iOS to automatically determine navigation bar translucency based on the transparency of BarBackgroundColor, aligning with Shell's existing behavior. The iOS-specific platform configuration for setting translucency is marked as obsolete in .NET 10.
Key changes:
- Navigation bar translucency is now automatically set based on
BarBackgroundColoralpha value - iOS-specific translucency API is marked obsolete with appropriate deprecation warnings
- Legacy explicit translucency settings are still respected for backward compatibility
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| PublicAPI.Unshipped.txt (iOS/MacCatalyst) | Removes public API methods for translucency mapping |
| NavigationPage.cs | Marks iOS-specific translucency API as obsolete |
| NavigationPageExtensions.cs | Removes obsolete translucency update method |
| NavigationPage.iOS.cs | Removes translucency mapping methods |
| NavigationPage.Mapper.cs | Removes translucency property mapping |
| NavigationRenderer.cs | Implements new translucency logic based on background color alpha |
Comments suppressed due to low confidence (1)
src/Controls/src/Core/Compatibility/Handlers/NavigationPage/iOS/NavigationRenderer.cs:879
- There is an extra closing brace here. The RefreshBarBackground method appears to have an additional closing brace that doesn't match an opening brace, which will cause a compilation error.
}
Member
|
/rebase |
57fda58 to
42228e6
Compare
Member
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
42228e6 to
df0256e
Compare
df0256e to
abe8c22
Compare
Member
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
abe8c22 to
1b7aaa6
Compare
1b7aaa6 to
0724965
Compare
Contributor
|
/rebase |
0724965 to
0023974
Compare
Contributor
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
jsuarezruiz
suggested changes
Sep 11, 2025
src/Controls/src/Core/PlatformConfiguration/iOSSpecific/NavigationPage.cs
Show resolved
Hide resolved
jsuarezruiz
reviewed
Sep 17, 2025
src/Controls/src/Core/Compatibility/Handlers/NavigationPage/iOS/NavigationRenderer.cs
Show resolved
Hide resolved
jsuarezruiz
approved these changes
Sep 18, 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.
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Description of Change
Currently, the NavigationBar.Translucent property could only be set using the iOS-specific platform configuration.
This PR updates the behavior to align with Shell, where translucency is automatically determined based on the transparency (alpha) of the background color.
For
Shell, it is based onShell.BackgroundColor.For
NavigationPage, it is now based onNavigationPage.BarBackgroundColor.The iOS-specific platform configuration for setting Translucent has been marked as obsolete in .NET 10.
In .NET 10:
If the platform-specific setting is explicitly set, it will still be respected, even if BarBackgroundColor is transparent.
If the platform-specific setting is not set, translucency will be determined based on the alpha value of NavigationPage.BarBackgroundColor.