Search code examples
xamluser-interfacexamarin.formsresourcedictionary

Xamarin Form - How to change TabbedPage title font size in ResourceDictionary


I have created a TabbedPage with four ContentPages as the TabbedPage.Children with Title. The Titles presented in iOS app is perfect and able to read. However, in Android it seems the Title font size is too large to be displayed even I change the Preference Font Size in the Android device's setting.

Here is my TabbedPage XAML file

<?xml version="1.0" encoding="UTF-8"?>
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms" 
            xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" 
            xmlns:local="clr-namespace:MyApplication.Views;assembly=MyApplication"
            x:Class="Demo.TabbedPageView"
            Title="My Application">
    <TabbedPage.Children>
        <local:View One/>
        <local:View Two/>
        <local:View Three/>
        <local:View Four/>
    </TabbedPage.Children>
</TabbedPage>

TabbedPage Screenshot

iOS - https://ibb.co/fmCZcH

Android - https://ibb.co/drEQjx

My questions are

  1. How can I change the Title's font size in ResourceDictionary?
  2. Is there any other way to achieve the same goal in this case?

Solution

  • You could use custom style and change the text size of the tabs.
    See this How to use custom style for tab

    And change the style:

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