roubachof / Sharpnado.Presentation.Forms

Presentation layer: Xamarin Forms custom components and renderers
594 stars 74 forks source link

TabHostView does not update background color in dark mode #94

Closed jbachelor closed 4 years ago

jbachelor commented 4 years ago

First and Foremost: Thank you so much for this awesome library... I sincerely appreciate all the hard work you've put into it!

Platform (please complete the following information):

Describe the bug In my efforts to implement Dark Mode support for Android and iOS along with a Sharpnado tab bar, I've found that the tab bar does not seem to update its color after it is initially set, while other components do update.

To Reproduce -- Short version

  1. Grab my modified Sharpnado sample here.
  2. When you run the app on an iOS or Android device that supports dark mode, try switching from light to dark. Notice that the ContentPage will update to a new color, but the tab bar remains in the original light color.
    • See this gif for a look at a demo on an iOS simulator running iOS 13.2.

The long version of how to reproduce: In my sample project (link below), I'm using the standard Sharpnado sample app with the following modifications:

Exceptions (if applicable) n/a

Screenshots (if applicable)

image

roubachof commented 4 years ago

man you're my favorite bug reporter :)

jbachelor commented 4 years ago

I figure it's the least I can do... I am super grateful for this awesome library! =D

roubachof commented 4 years ago

ahah found it! Will be fixed in 1.4.

muhaym commented 3 years ago

Hi @roubachof Seems this affects other Colour properties as well. SelectedTabColor, UnselectedIconColor, UnselectedLabelColor - Need to Exit App and open to see the changes reflected properly

Settings in this way

  <ContentPage.Resources>
        <ResourceDictionary>
            <converter:NameToShortConverter x:Key="NameToShortConverter" />
            <Style x:Key="BottomTabStyle" TargetType="tabs:BottomTabItem">
                <Setter Property="SelectedTabColor" Value="{DynamicResource IconPrimaryColor}" />
                <Setter Property="UnselectedIconColor" Value="{DynamicResource IconColor}" />
                <Setter Property="UnselectedLabelColor" Value="{DynamicResource IconColor}" />
                <Setter Property="LabelSize" Value="14" />
                <Setter Property="IconSize" Value="28" />
                <Setter Property="IsTextVisible" Value="True" />
            </Style>
        </ResourceDictionary>
    </ContentPage.Resources>

            <tabs:TabHostView.Tabs>
                <tabs:BottomTabItem
                    x:Name="HomeTab"
                    IconImageSource="home.png"
                    Label="{x:Static resource:AppResources.hometab}"
                    Style="{StaticResource BottomTabStyle}" />
                <tabs:BottomTabItem
                    x:Name="MyCourseTab"
                    IconImageSource="courses.png"
                    Label="{x:Static resource:AppResources.mycourse}"
                    Style="{StaticResource BottomTabStyle}" />

            </tabs:TabHostView.Tabs>

Inconsistent behaviour during Theme Changes.

ezgif com-video-to-gif

Am I doing something wrong?