【发布时间】:2018-10-23 06:16:48
【问题描述】:
我在 Xamarin Forms 中有以下代码:
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:XXX;assembly=XXX"
xmlns:android="clr-namespace:Xamarin.Forms.PlatformConfiguration.AndroidSpecific;assembly=Xamarin.Forms.Core"
BackgroundColor="{DynamicResource BarBackgroundColor}"
android:TabbedPage.ToolbarPlacement="Bottom"
android:TabbedPage.BarItemColor="Gray"
android:TabbedPage.BarSelectedItemColor="{DynamicResource BarSelectedItemColor}"
android:TabbedPage.IsSwipePagingEnabled="False"
x:Class="XXX.MainPage">
</TabbedPage>
我想更改Android 侧的标签栏文本的大小。我尝试过创建自己的风格,如下所示:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="MyTabLayoutStyle" parent="TextAppearance.Design.Tab">
<item name="android:textSize">5sp</item>
</style>
</resources>
在我的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/tabs"
android:layout_width="match_parent"
app:tabGravity="fill"
app:tabMode="fixed"
app:tabTextAppearance="@style/MyTabLayoutStyle"/>
我感觉这不起作用,因为我使用的是TabbedPage.ToolbarPlacement="Bottom",而不是使用TabLayout,我现在使用的是BottomNavigationView。因此,上面的问题是,使用TabbedPage.ToolbarPlacement="Bottom"时如何更改标签栏的文本大小。
【问题讨论】:
标签: xamarin xamarin.forms xamarin.android