如何更改 Xamarin Forms 导航栏标题区域的字体大小?

Ala*_*an2 2 xamarin xamarin.forms

我拥有的字体对于我想要显示的字数来说太大了。有没有人对我如何更改字体大小有任何建议。我希望能够在共享代码中做到这一点,但如果它需要一个自定义渲染器,那么有人可以告诉我如何做到这一点吗?

Wil*_*gas 6

因此,如果您使用的是 Xamarin.Forms 3.2.0 或更高版本,则可以使用如下TitleView属性:

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
         xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
         x:Class="Xamarin.Forms.Controls.GalleryPages.TitleView">

    <NavigationPage.TitleView>
        <Label Text="This is my Title" FontSize="12" TextColor="White" />
    </NavigationPage.TitleView>

    <!-- YOUR CONTENT HERE-->
</ContentPage>
Run Code Online (Sandbox Code Playgroud)