When using Shell, where is the FontFamily and FontSize defined for the page title?

Kurt K 176 Reputation points
2022-12-27T21:58:12.497+00:00

Here is an example of the page title I'm talking about:

274259-pagetitle.png

I can find the default app styles in Resources\Styles\Styles.xaml, and colors in Resources\Styles\Colors.xaml.

However, I cannot find the anything for Shell app page titles.

I have the same question (FontFamily and FontSize definitions) for buttons added to the title area as follows:

<ContentPage.ToolbarItems>  
    <ToolbarItem Text="Button Text" />  
</ContentPage.ToolbarItems>  

Thank you.

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
4,033 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Leon Lu (Shanghai Wicresoft Co,.Ltd.) 81,021 Reputation points Microsoft External Staff
    2022-12-28T02:37:40.673+00:00

    Hello,

    When using Shell, where is the FontFamily and FontSize defined for the page title?

    You can create a global style in the Styles.xml like following code.

       <Style x:Key="shellTitleStyle" TargetType="Label">  
                      <Setter Property="FontFamily" Value="OpenSans-Semibold" />  
                       <Setter Property="FontSize" Value="Large" />  
         </Style>  
    

    Then you can set the style of shell title.

       <Shell.TitleView>  
               <Label Text="main"  Style="{StaticResource shellTitleStyle}"></Label>  
           </Shell.TitleView>  
    

    I have the same question (FontFamily and FontSize definitions) for buttons added to the title area

    ToolbarItems do not have style, if you want to set it, you can do this by handler.

    As note: Ask one question at a time

    Best Regards,

    Leon Lu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.