On UWP the TitleView does not take up all the available space. There is a margin at the bottom and left.
````xaml
HorizontalOptions="FillAndExpand"
VerticalOptions="FillAndExpand" />
<Grid BackgroundColor="Yellow">
</Grid>
````
Grid with BackgroundColor="Red"
Fill Header without margins:
Grid has Left 10px
and Bottom 8px
Margin:
Live Visual Tree of Header:
It is the Border
in TitleViewPresenter
that takes width=10px
and height=48px
. This one should have Visibility=Collapsed
.
Hm I wonder if this has some connection to what is going on in #5661
@jfversluis Thanks! This also fixes the left "Padding" on TitleView?
Hm that I don't think so, this focusses mostly on the bottom thing. But it should be in the same area
Confirmed this happening in the attached repro project.
I've tried to look into this. It appears the implementation of the TitleView in UWP is such, that it co-exists with the TitleIcon and Title properties, and this is causing the problems.
This becomes more obvious if a Title is added to the repro @jfversluis provided:
Note how the "Title" intrudes on the TitleView.
The left padding is caused by these lines in the default PageControlStyle - where a grid with 3 columns are used: one for any icon, one for the title, and one for the TitleView. As the TextBlock for the Title includes a left padding of 10, this is always there.
I can fix this, but I need to be sure my understanding is correct: that if a TitleView is specified, this should take precedence, and neither the Icon ot the Title property should be shown; but if no TitleView is specified, the Icon and Title should be shown.
?
My temp workaround (hide TextBlock
of Title
in entire app):
````xaml
<x:Double x:Key="AppBarThemeCompactHeight">48</x:Double>
<x:Double x:Key="AppBarExpandButtonThemeWidth">0</x:Double>
```
In my opinion, the [Title TextBlock](https://github.com/xamarin/Xamarin.Forms/blob/f06cb1f652ca5feac719a20cac98c9a61fd461aa/Xamarin.Forms.Platform.UAP/PageControlStyle.xaml#L35) should be collapsed when no
Title` provided.
Most helpful comment
My temp workaround (hide
TextBlock
ofTitle
in entire app):````xaml
```
In my opinion, the [Title TextBlock](https://github.com/xamarin/Xamarin.Forms/blob/f06cb1f652ca5feac719a20cac98c9a61fd461aa/Xamarin.Forms.Platform.UAP/PageControlStyle.xaml#L35) should be collapsed when no
Title` provided.