Forum Xamarin.Forms

Xamarin.Forms with Shell: is there a way to specify a icon's color for active tab only?

PacodosoPacodoso FRUniversity ✭✭✭

I'm working on a Xamarin.Forms app based on Shell, and I'm using font icons as icons for the TabBar:

<TabBar>
    <ShellContent Title="Home" Route="HomePage" ContentTemplate="{DataTemplate local:HomePage}">
        <ShellContent.Icon>
            <FontImageSource Glyph="{StaticResource FasIconHome}" FontFamily="FontAwesomeSolid" />
        </ShellContent.Icon>
    </ShellContent>
</TabBar>

I would like to specify a color only for the active tab, but only for the icon, not for the text, as we can see on Airbnb:
Airbnb screenshot

I didn't found any option in the Shell settings:

<Setter Property="Shell.BackgroundColor" Value="White" />
<Setter Property="Shell.ForegroundColor" Value="Black" />
<Setter Property="Shell.TitleColor" Value="Black" />
<Setter Property="Shell.DisabledColor" Value="{StaticResource Gray-300}" />
<Setter Property="Shell.UnselectedColor" Value="{StaticResource Gray-300}" />
<Setter Property="Shell.TabBarBackgroundColor" Value="White" />
<Setter Property="Shell.TabBarForegroundColor" Value="{StaticResource Gray-300}"/>
<Setter Property="Shell.TabBarUnselectedColor" Value="#95000000" />
<Setter Property="Shell.TabBarTitleColor" Value="Black" />

Is it possible?

Best Answer

Answers

  • LeonLuLeonLu Member, Xamarin Team Xamurai

    @Pierre-ChristopheDus Are there any update for this issue? If the reply is helpful, please click the "Yes" tab under the helpful answer.

  • PacodosoPacodoso FRUniversity ✭✭✭

    @LeonLu thanks for your feedback. It was not exactly the expected answer, as I would like to use a font as icon. I don't want to embed a lot of images, but I don't think that there is another solution...

Sign In or Register to comment.