Xamarin.android 设置选项卡式页面选项卡文本的自定义字体大小

Xamarin.android 设置选项卡式页面选项卡文本的自定义字体大小,xamarin.android,xamarin.forms,Xamarin.android,Xamarin.forms,我试图减少标签文本的大小,因为它会被长文本截断。我尝试了下面的解决方案,但似乎不起作用 <style name="MainTheme" parent="MainTheme.Base"> </style> <!-- Base theme applied no matter what API --> <style name="MainTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar"

我试图减少标签文本的大小,因为它会被长文本截断。我尝试了下面的解决方案,但似乎不起作用

 <style name="MainTheme" parent="MainTheme.Base">
  </style>
  <!-- Base theme applied no matter what API -->
  <style name="MainTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
    <!--If you are using revision 22.1 please use just windowNoTitle. Without android:-->
    <item name="windowNoTitle">true</item>
    <!--We will be using the toolbar so no need to show ActionBar-->
    <item name="windowActionBar">false</item>
    <!-- Set theme colors from http://www.google.com/design/spec/style/color.html#color-color-palette -->
    <!-- colorPrimary is used for the default action bar background -->
    <item name="colorPrimary">#2196F3</item>
    <!-- colorPrimaryDark is used for the status bar -->
    <item name="colorPrimaryDark">#1976D2</item>
    <!-- colorAccent is used as the default value for colorControlActivated
         which is used to tint widgets -->
    <item name="colorAccent">#FF4081</item>
    <!-- You can also set colorControlNormal, colorControlActivated
         colorControlHighlight and colorSwitchThumbNormal. -->
    <item name="windowActionModeOverlay">true</item>

    <item name="android:datePickerDialogTheme">@style/AppCompatDialogStyle</item>

    <item name="android:actionBarTabTextStyle">@style/CustomTab</item>
    <item name="actionBarTabTextStyle">@style/CustomTab</item>
  </style>

  <style name="CustomTab"
         parent="@style/Widget.AppCompat.Light.ActionBar.TabText">
    <item name="android:textSize">5sp</item>
  </style>

真的
假的
#2196F3
#1976D2
#FF4081
真的
@样式/应用程序对话框样式
@样式/自定义选项卡
@样式/自定义选项卡
5便士
有人能帮我吗?

在styles.xml中

  <style name="MyTabLayout" parent="Base.Widget.Design.TabLayout">
    <item name="tabTextAppearance">@style/MyTabTextAppearance</item>
  </style>

  <style name="MyTabTextAppearance" parent="TextAppearance.AppCompat.Button">
    <item name="android:textSize">5sp</item>
  </style>

@样式/MyTabTextAppearance
5便士
在Tabbar.axml中

<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"
    style="@style/MyTabLayout"
    app:tabGravity="fill"
    app:tabMode="fixed" />

哇,谢谢你。工作起来很有魅力。嗨,我已经在我的styles.xml文件中编写了你给定的代码,但运气不好,请猜我错过了什么。不知道你错过了什么