C# xamarin表单更改所选选项卡颜色文本

C# xamarin表单更改所选选项卡颜色文本,c#,xamarin,mobile,C#,Xamarin,Mobile,我正在使用Xamarin跨平台表单选项卡页面。 我想更改所选选项卡的颜色文本。 我可以改变背景和文字的颜色。 我需要更改所选选项卡的颜色文本。 这是我的密码 var page = new tabPage() { BarBackgroundColor = Color.WhiteSmoke, BarTextColor = Color.Black

我正在使用Xamarin跨平台表单选项卡页面。 我想更改所选选项卡的颜色文本。 我可以改变背景和文字的颜色。 我需要更改所选选项卡的颜色文本。 这是我的密码

var page = new tabPage()
                    {
                        BarBackgroundColor = Color.WhiteSmoke,
                        BarTextColor = Color.Black
                    };


<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="ABCAPP.Views.MainPage"  >
    <!--Pages can be added as references or inline-->

    <ContentPage Title="ALL"  >
    </ContentPage>

<ContentPage Title="Email"   >
</ContentPage>

 <ContentPage Title="phoe"   >
</ContentPage>
var page=new tabPage()
{
BarBackgroundColor=Color.WhiteSmoke,
BarTextColor=颜色。黑色
};

如果我们选择“电子邮件”,我想更改“电子邮件”,文本颜色。 如何操作?

Xaml代码:

<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
         xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
         xmlns:local="clr-namespace:App3"
         x:Class="App3.MainPage"
        BarBackgroundColor="Yellow"> 
    <local:Page1/>
    <local:Page1/>
</TabbedPage>
希望这能解决你的问题

<?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:tabSelectedTextColor="@color/accent_material_light"
app:tabTextColor="@color/accent_material_dark"
app:tabMode="fixed" />