Android TabColor未在ThriveGmbH.BottomNavigationBar.XF xamarin.forms中设置
我在xamarin.forms中使用“BottomNavigationBar”来实现底部栏。我根据下面的链接定制它。我还没有实现直接的nuget 版本详细信息 xamarin.forms:3.0.482510 底部导航栏:1.4.0.3 Xamarin.Android.Support.Design:25.4.0.2 问题: TabColor不是根据样本设置的。默认颜色为白色。 代码:Android TabColor未在ThriveGmbH.BottomNavigationBar.XF xamarin.forms中设置,android,xamarin,xamarin.forms,xamarin.android,bottomnavigationview,Android,Xamarin,Xamarin.forms,Xamarin.android,Bottomnavigationview,我在xamarin.forms中使用“BottomNavigationBar”来实现底部栏。我根据下面的链接定制它。我还没有实现直接的nuget 版本详细信息 xamarin.forms:3.0.482510 底部导航栏:1.4.0.3 Xamarin.Android.Support.Design:25.4.0.2 问题: TabColor不是根据样本设置的。默认颜色为白色。 代码: <xf:BottomBarPage xmlns="http://xamarin.com/schemas/2
<xf:BottomBarPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Inika.Views.BottomBar.BottomBarPages"
xmlns:pages="clr-namespace:Inika.Views.Category;assembly=Inika"
xmlns:xf="clr-namespace:Inika.Views.BottomBar;assembly=Inika">
<!--Pages can be added as references or inline-->
<pages:Product Title="PRODUCT" Icon="ic_favorites.png" xf:BottomBarPageExtensions.TabColor="#5D4037"/>
<ContentPage Title="APPLICATION" Icon="ic_nearby.png" xf:BottomBarPageExtensions.TabColor="#7B1FA2"/>
<ContentPage Title="IMAGES" Icon="ic_restaurants.png" xf:BottomBarPageExtensions.TabColor="#FF5252"/>
</xf:BottomBarPage>
但是xf:BottomBarPageExtensions.TabColor=“#FF5252”不能正常工作
期望
Tabbar.axml
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.TabLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/sliding_tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:tabIndicatorColor="@android:color/white"
app:tabGravity="fill"
app:tabMode="fixed"/>
我的自定义渲染也被称为完美渲染。我不明白。在示例中,一切正常,但当我在项目中实现相同的东西时,它不起作用。
我应该使用ThriveGmbH.BottomNavigationBar.XF的v1.0.3版而不是v1.0.2版吗?
然后,您必须使用FixeMode并在Android渲染器中使用以下代码设置背景颜色或选项卡的活动或不活动
_bottomBar.UseFixedMode();
_bottomBar.LayoutParameters = new LayoutParams(LayoutParams.MatchParent, LayoutParams.MatchParent);
_bottomBar.SetOnTabClickListener(this);
_bottomBar.SetTypeFace("SF-UI-Text-Regular.ttf");
_bottomBar.SetActiveTabColor("#434A4F");
_bottomBar.SetFixedInactiveIconColor("#d0d0d0");
_bottomBar.SetBackgroundColor(Android.Graphics.Color.Violet);
UpdateTabs();
UpdateBarBackgroundColor();
UpdateBarTextColor();
你能分享自定义渲染器代码吗?自定义渲染器与下面的链接相同,谢谢回复。“SetActiveTabColor”和“SetBackgroundColor”即使在正常模式下也无法在固定模式下工作。我的问题是为什么“xf:BottomBarPageExtensions.TabColor”在XMAL中不起作用。