2

Why are page titles defaulted to uppercase in TabbedPage?

https://learn.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/navigation/tabbed-page

This link to the documentation of TabbedPage shows examples where the tabbed page titles are Titlecase in code but uppercase on the UI. As seen below:

<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
            xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
            xmlns:local="clr-namespace:TabbedPageWithNavigationPage;assembly=TabbedPageWithNavigationPage"
            x:Class="TabbedPageWithNavigationPage.MainPage">
    <local:TodayPage />
    <NavigationPage Title="Schedule" IconImageSource="schedule.png">
        <x:Arguments>
            <local:SchedulePage />
        </x:Arguments>
    </NavigationPage>
</TabbedPage>

Schedule page

Zaren Wienclaw
  • 181
  • 4
  • 15

1 Answers1

5

If you take a look at the source code of the Android-specific renderer on GitHub, you can see that Xamarin.Forms internally uses the TabLayout control to create the tabs. This also means that you're stuck with whatever Android devs have specified to be the appearance of the title text, in this case it's all uppercase by default.

However, this can still be customized by creating a custom effect that modifies the relevant property on the native control. Take a look at this article on how to create a custom effect on Android and you should probably find the property(ies) to modify from the following SO question.

Usually, when you see something like this, it's because Xamarin.Forms is simply using the native control with some or no modifications applied to it. At that point you'll want to create and effect or even a custom renderer to change the look and feel on a much deeper level to fit your needs.

Timo Salomäki
  • 7,099
  • 3
  • 25
  • 40