【发布时间】:2021-03-27 05:11:07
【问题描述】:
我正在使用 Xamarin Forms 制作应用程序。我有一个选项卡式页面,并希望更改选项卡式指示器的颜色。但是我无法将其从默认的白色更改。
一个白色指示器示例:
我已尝试更改 Tabbar.xml 文件中的 tabIndicatorColor,如下所示:
<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="@color/colourSelected"
app:tabGravity="fill"
app:tabMode="fixed" />
但这并没有改变它,无论我使用什么颜色,指示器仍然是白色的。我该如何解决这个问题?
【问题讨论】:
-
直接用十六进制代码试试
app:tabIndicatorColor="#FF9F11" -
我试过了,还是没有变化
-
不,我使用的是 TabbedPage。将 android 编译版本从 10.0 更改为 9.0 似乎可以解决问题
标签: c# xamarin xamarin.forms indicator tabbedpage