我正在使用 COOL xamarin shell,但我没有找到更改所选选项卡图标的方法。
<TabBar Route="sections">
<Tab Title="home">
<Tab.Icon>
<FontImageSource FontFamily="{StaticResource AppIcons}" Glyph="{x:Static framework:Icons.HomePage}" />
</Tab.Icon>
<ShellContent ContentTemplate="{DataTemplate home:HomePage}" Route="home" />
</Tab>
Run Code Online (Sandbox Code Playgroud)
目标是仅在选择此选项卡时使用Icons.HomePageFilled而不是用于该选项卡。Icons.HomePage相同的逻辑应该适用于其他选项卡。
我想我迷失在网上找到的解决方案中了。他们谈论自定义渲染器(ShellTabLayoutAppearanceTracker),视觉状态,效果等......但我不知道它是否可行以及理想的解决方案是什么
xaml custom-renderer xamarin.ios xamarin.android xamarin.forms