Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AppThemeBinding BarBackground with Brush in NavigationPage and TabbedPage not working #24356

Open
AlleSchonWeg opened this issue Aug 21, 2024 · 2 comments · May be fixed by #24425
Open

AppThemeBinding BarBackground with Brush in NavigationPage and TabbedPage not working #24356

AlleSchonWeg opened this issue Aug 21, 2024 · 2 comments · May be fixed by #24425
Labels
area-drawing Shapes, Borders, Shadows, Graphics, BoxView, custom drawing area-navigation NavigationPage platform/android 🤖 platform/iOS 🍎 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working

Comments

@AlleSchonWeg
Copy link

Description

Hi,
if you set a brush as BarBackground in a TabbedPage or in a NavigationPage Style with AppThemeBinding the colors are not changed if the user change the theme.
Sample:

  <TabbedPage.BarBackground>
    <LinearGradientBrush StartPoint="0,0"
                         EndPoint="0,1">
      <GradientStop Color="{AppThemeBinding Light=Red, Dark=Brown}"
                    Offset="0.0" />
      <GradientStop Color="{AppThemeBinding Light=Green, Dark=Yellow}"
                    Offset="0.5" />
      <GradientStop Color="{AppThemeBinding Light=Green, Dark=Yellow}"
                    Offset="0.5" />
      <GradientStop Color="{AppThemeBinding Light=Red, Dark=Brown}"
                    Offset="1.0" />
    </LinearGradientBrush>
  </TabbedPage.BarBackground>
  <Style TargetType="NavigationPage">
    <Setter Property="BarBackground">
      <OnPlatform x:TypeArguments="Brush">
        <On Platform="Android">
          <LinearGradientBrush StartPoint="0,0"
                               EndPoint="0,1">
            <GradientStop Color="{AppThemeBinding Light=Red, Dark=Brown}"
                          Offset="0.0" />
            <GradientStop Color="{AppThemeBinding Light=Green, Dark=Yellow}"
                          Offset="0.5" />
            <GradientStop Color="{AppThemeBinding Light=Green, Dark=Yellow}"
                          Offset="0.5" />
            <GradientStop Color="{AppThemeBinding Light=Red, Dark=Brown}"
                          Offset="1.0" />
          </LinearGradientBrush>
        </On>
        <On Platform="iOS">
          <SolidColorBrush Color="{AppThemeBinding Light=Red, Dark=Green}" />
        </On>
      </OnPlatform>
    </Setter>
    <Setter Property="BarTextColor"
            Value="{AppThemeBinding Light=Blue, Dark=Yellow}" />
  </Style>

Setting BarBackground={AppThemeBinding Light=Red, Dark=Brown} works.

Steps to Reproduce

  • Open sample app
  • Change theme dark/light via system settings

NavigationPage and TabbedPage background should change the colors.

I tested only Android. Please check also iOS if it works as expected.
Version: 8.0.90-ci.net8.24420.2
MauiApp6.zip

Link to public reproduction project repository

No response

Version with bug

Nightly / CI build (Please specify exact version)

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

iOS, Android

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

No response

@AlleSchonWeg AlleSchonWeg added the t/bug Something isn't working label Aug 21, 2024
Copy link
Contributor

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@kevinxufei kevinxufei added platform/android 🤖 platform/iOS 🍎 s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Aug 22, 2024
@kevinxufei
Copy link

I can repro this issue at Android/iOS platforms on the latest 17.12.0 Preview 1.0(8.0.90-ci.net8.24420.2 & 8.0.80). The dark/light system theme changes, but the background color does no change.

@samhouts samhouts added area-drawing Shapes, Borders, Shadows, Graphics, BoxView, custom drawing area-navigation NavigationPage labels Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-drawing Shapes, Borders, Shadows, Graphics, BoxView, custom drawing area-navigation NavigationPage platform/android 🤖 platform/iOS 🍎 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants