Skip to content

Conversation

@Tamilarasan-Paranthaman
Copy link
Contributor

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 on Shell.BackgroundColor.

  • For NavigationPage, it is now based on NavigationPage.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.

@dotnet-policy-service dotnet-policy-service bot added community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration labels Aug 1, 2025
@Tamilarasan-Paranthaman Tamilarasan-Paranthaman marked this pull request as ready for review August 4, 2025 12:45
Copilot AI review requested due to automatic review settings August 4, 2025 12:45
@Tamilarasan-Paranthaman Tamilarasan-Paranthaman requested a review from a team as a code owner August 4, 2025 12:45
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 BarBackgroundColor alpha 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.
		}

@rmarinho
Copy link
Member

/rebase

@github-actions github-actions bot force-pushed the Net10-NavigationPage-NavigationBar branch from 57fda58 to 42228e6 Compare August 13, 2025 11:55
@rmarinho
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@Tamilarasan-Paranthaman Tamilarasan-Paranthaman force-pushed the Net10-NavigationPage-NavigationBar branch from 42228e6 to df0256e Compare August 19, 2025 11:26
@PureWeen PureWeen added this to the .NET 10.0-rc2 milestone Aug 23, 2025
@PureWeen PureWeen force-pushed the Net10-NavigationPage-NavigationBar branch from df0256e to abe8c22 Compare August 23, 2025 22:22
@PureWeen
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@Tamilarasan-Paranthaman Tamilarasan-Paranthaman force-pushed the Net10-NavigationPage-NavigationBar branch from abe8c22 to 1b7aaa6 Compare September 3, 2025 03:33
@PureWeen PureWeen moved this from Todo to Ready To Review in MAUI SDK Ongoing Sep 3, 2025
@Tamilarasan-Paranthaman Tamilarasan-Paranthaman force-pushed the Net10-NavigationPage-NavigationBar branch from 1b7aaa6 to 0724965 Compare September 8, 2025 10:00
@jsuarezruiz
Copy link
Contributor

/rebase

@github-actions github-actions bot force-pushed the Net10-NavigationPage-NavigationBar branch from 0724965 to 0023974 Compare September 11, 2025 15:00
@jsuarezruiz
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

#region Translucent
/// <summary>Bindable property for <see cref="IsNavigationBarTranslucent"/>.</summary>

[Obsolete("IsNavigationBarTranslucent is deprecated. The Translucent will be enabled by default by setting the BarBackgroundColor to a transparent color.")]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about the BarBackground property? (using a brush). If create a brush from transparent to a color, should apply the Translucent too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jsuarezruiz, yes, if we set the BarBackground to a transparent color brush, it will behave as translucent, similar to how BarBackgroundColor works.

@github-project-automation github-project-automation bot moved this from Ready To Review to Changes Requested in MAUI SDK Ongoing Sep 11, 2025
@PureWeen PureWeen moved this from Changes Requested to Ready To Review in MAUI SDK Ongoing Sep 15, 2025
if (_currentBarBackgroundColor?.Alpha < 1f)
navigationBarAppearance.ConfigureWithTransparentBackground();
// If user explicitly set translucent property, respect that value
if (isNavigationBarTranslucentExplicitlySet)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate logic in both iOS 13+ and pre-iOS 13 branches, could creare a method and reuse it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jsuarezruiz, the way translucency/opacity is applied differs between iOS 13+ (UINavigationBarAppearance) and pre-iOS 13 (BarTintColor / SetBackgroundImage), so I don’t think we can fully unify those blocks without introducing another branch inside the shared method. I extracted the common decision logic into a method but kept the application code separate since the APIs differ and require a different approach.

@github-project-automation github-project-automation bot moved this from Ready To Review to Approved in MAUI SDK Ongoing Sep 18, 2025
@PureWeen PureWeen merged commit c49a5c0 into dotnet:net10.0 Sep 18, 2025
152 checks passed
@github-project-automation github-project-automation bot moved this from Approved to Done in MAUI SDK Ongoing Sep 18, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Oct 19, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants