Reputation: 5968
I have .Net 7 Maui app.
When the app is deployed to a physical device from Visual Studio, the top bar has the correct color set.
However when the exact same project app is published to Play Store, the top bar color is different.
It's the exact same project.
How can I solve that?
App deployed from Visual Studio to a physical device: Correct color
Published app downloaded from the play store: Incorrect color
Here is how the color is set:
in Resources/styles/colors.xml:
<Color x:Key="LightModePageBarColor">#799ff6</Color>
in app_shell.xml:
<?xml version="1.0" encoding="UTF-8" ?>
<Shell
x:Class="MyProject.AppShell"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:MyProject"
BackgroundColor="{StaticResource LightModePageBarColor}">
... shell content
</Shell>
in Resources/styles/styles.xml:
<Style TargetType="NavigationPage">
<Setter Property="BarBackgroundColor" Value="{AppThemeBinding Light={StaticResource LightModePageBarColor}, Dark={StaticResource DarkModePageBarColor}}" />
</Style>
Upvotes: 1
Views: 980