This repository has been archived by the owner on May 1, 2024. It is now read-only.
[Bug] Brushes: NavigationBar.BarBackgroundColor assignment prevents NavigationBar.BarBackground brush rendering on Android #13491
Labels
a/brushes
a/navbar
e/3 🕒
3
in-progress
This issue has an associated pull request that may resolve it!
t/bug 🐛
Description
On iOS, when both a background color and a brush are defined on a NavigationBar, the brush will take precedence.
On Android, if a background color property is defined in any way on a NavigationBar, the brush will never be drawn.
So if your NavigationBar XAML looks like
the BarBackground will not render on Android. Removing the 'BarBackgroundColor="Transparent"' property assignment makes the brush draw properly.
Not having a BarBackgroundColor assignment at all or setting it to Transparent should be equivalent (as a Color's default value is Transparent), yet the mere presence of said assignment makes brushes not draw on Android. This leads me to believe that a side-effect happens in the actual assignment on Android, which makes it draw incorrectly.
Use case is for example platform dependent colouring where one platform should use a color and another a brush.
The error seems to only happen with a NavigationBar, for example a ContentPage's background copes with this properly.
Edit: Clarified that issue only happens with a NavigationBar
Expected Behavior
BarBackgroundColor="Transparent" should have no effect on Android when a Brush is also defined.
Actual Behavior
The mere presence of a BarBackgroundColor assignment, even when used to set the value to the default Transparent, makes the brush not render on Android.
Basic Information
Environment
Show/Hide Visual Studio info
The text was updated successfully, but these errors were encountered: