1

I am defining a custom Shell.TitleView in a way to preserve the Tab/Page title of my ContentPage as follow:

<Shell.TitleView>
    <Label Text="Page2" FontSize="20" VerticalTextAlignment="Center"/>
    <!-- rest of my TitleView irrelevant in this question-->
</Shell.TitleView>

The issue here is that the generated title by the default Shell.TitleView (in the second Tab) is different from mine (the difference is more noticeable when you navigate from one tab to the other than in screenshots), at first I thought it was a matter of combination between FontSize and FontAttributes="bold".

enter image description here enter image description here

Clarification

  • 1st Tab: using my custom Shell.TitleView.
  • 2nd Tab: Without using/defining a Shell.TitleView.
  • I am not using any style or custom font just using the empty template project for shell flyout.
  • By different I mean that the custom title text in app bar is a bit bolder, removing bold attribute won't make it same.

What is causing this difference? if it is because of different FontFamily, then What is the FontFamilly used by the default Shell.TitleView?

How to make it same?

EDIT

With Opacity and TextColor they are almost similiar but still not 100%.

<Shell.TitleView>
   <Label Text="Page2" FontSize="20" VerticalTextAlignment="Center" FontAttributes="Bold"
               Opacity="1" TextColor="White"/>
</Shell.TitleView>

enter image description here enter image description here

Cfun
  • 6,507
  • 4
  • 21
  • 53
  • I'm not so clear about your question, you want the two `Pages` has the same fontsize? – nevermore Nov 09 '20 at 05:45
  • @JackHua-MSFT No it is not a matter of font size, I am not sure what is causing the difference in the title text between default titleview and custom titleview that is only setting the same text for title without alterning any other property. Maybe it is fontfamily or something else this is what I want to understand the reason of this small difference almost not noticeable. – Cfun Nov 09 '20 at 06:55
  • `causing the difference in the title text`? What is the difference? – nevermore Nov 09 '20 at 06:58
  • @JackHua-MSFT please zoom the last two screenshots, you will notice something a bit different in the title text font. As i mentioned it will be more noticeable (that something is different in the way the title text is written) when you navigate from one page to another especially that the title text string is same. Have you noticed the difference? – Cfun Nov 09 '20 at 07:20
  • You mean the title in first tab is a little 'bold' that the title in second tab? – nevermore Nov 09 '20 at 07:27
  • @JackHua-MSFT Yes exactly I am speaking about the title text in the app bar(navigation bar) the one in tab is exactly same. And yea it seems a bit bolder (the custom one), but removing bold attribute in my custom titileview won't make it same. – Cfun Nov 09 '20 at 07:37
  • When you use `default Shell.TitleView`, there are some default FontSize , FontFamily which you don't know that defined by the system and it is different from yours. That's probably caused the difference. – nevermore Nov 09 '20 at 07:43
  • @JackHua-MSFT But when you define a custom titleview it is supposed to use the same default font as long as no font is set. So you think the solution would be to know the default font and then set it? I am thinking also it is a matter of FontFamilly, but don't how to solve this. – Cfun Nov 09 '20 at 08:08
  • No, you can consider that the default Shell.TitleView use a custom style which is different from the system fontsize. You can create your custom titleview and make it whatever you want to make, what's your question now? – nevermore Nov 09 '20 at 08:11
  • @JackHua-MSFT I want my `Label` which inside of my `` to use the same font as the default Title font used by Shell. – Cfun Nov 09 '20 at 08:19
  • The problem now is the we don't know what is the the default Title font. – nevermore Nov 09 '20 at 08:22
  • Well, I think it is not a problem. You can use you own custom fontsize/fontfamily to custom the titleview and it will all looks the same in the project. You can also try to find a fontfamily which looks the same as the default one. – nevermore Nov 09 '20 at 08:30
  • This can be an is alternative solution, but then I need to enforce this custom font to be used by the default Shell title only. – Cfun Nov 09 '20 at 08:36
  • OK, I will try later and check the source code. Will update you if find anything. – nevermore Nov 09 '20 at 09:53
  • Guess we didn't find anything then :( – Mansel Jan 06 '22 at 15:13

0 Answers0