Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android, iOS, WinUI] NavigationPage.TitleView not showing #3877

Closed
AlexeyZhukoff opened this issue Dec 29, 2021 · 6 comments
Closed

[Android, iOS, WinUI] NavigationPage.TitleView not showing #3877

AlexeyZhukoff opened this issue Dec 29, 2021 · 6 comments
Assignees
Labels
area-navigation NavigationPage delighter high It doesn't work at all, crashes or has a big impact. platform/android 🤖 s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working

Comments

@AlexeyZhukoff
Copy link

AlexeyZhukoff commented Dec 29, 2021

Implementation Notes

  • iOS should just work like it did currently in XF. If it's not showing up that's most likely an issue with the old code not playing nicely with the new layout system. NavigationPage on iOS is now based on a ViewHandler base so it should be easier to make this work
  • WinUI has been completely rewritten so I don't know how much of the old code will be re-usable here. The header control itself is mostly the same control so hopefully you can just plop the TitleView into the ContentControl and it'll work perfectly. Shell and NavigationPage on WinUI are now all based on the same core code so fixing this on NavigationPage should also take care of this issue.
  • The Android Toolbar is now using the Material Toolbar. The Material Toolbar has some additional APIs for centering the title text but I'm not sure if this will help us with the TitleView.

Stretch goal

xamarin/Xamarin.Forms#4848

One of the huge frustrations with the current titleview implementation is that it's VERY difficult to center your content. One of the hopes here was to make it so the TitleView would obey the LayoutOptions specified.

  • Nothing Specified: Maintain current behavior
  • Center: Center the content on the header
  • Start: align the content against the left edge (or against the back button/flyoutout button if present)
  • End: align the content against the right edge (or against the toolbar items if present)
  • Fill: TitleView takes up the entire appbar

Description

Not possible customize TitleView of Custom Page.
TitleView not shown.

Steps to Reproduce

  1. Create the .NET MAUI App
  2. Modificate MainPage.xaml, insert "<NavigationPage.TitleView></NavigationPage.TitleView>" after opened ContentPage tag.
  3. Run the application

Version with bug

Preview 11

Last version that worked well

Unknown/Other

Affected platforms

iOS, Android

Affected platform versions

iOS 15, Android 11

Did you find any workaround?

No

Relevant log output

No response

@AlexeyZhukoff AlexeyZhukoff added the t/bug Something isn't working label Dec 29, 2021
@PureWeen PureWeen changed the title [Android, iOS] NavigationPage.TitleView not showing [Android, iOS, WinUI] NavigationPage.TitleView not showing Jan 6, 2022
@PureWeen PureWeen self-assigned this Jan 6, 2022
@nogginbox
Copy link
Contributor

I'm also experiencing this. I thought I was doing it wrong!

It is also happening on Windows.

@jsuarezruiz jsuarezruiz added the high It doesn't work at all, crashes or has a big impact. label Jan 31, 2022
@PureWeen
Copy link
Member

PureWeen commented Feb 9, 2022

Related
xamarin/Xamarin.Forms#4848

@nevse
Copy link

nevse commented Feb 11, 2022

Let me clarify - the error is not in the layout, it is not displayed at all under the android

A simple project can be found here https://github.com/nevse/Maui-Tests-NavBarTitleView

image

@PureWeen
Copy link
Member

The TitleView property hasn't been ported over yet. The NavigationPage layer was rebuilt on Android/WinUI so they are pending re-implementation.

@kristinx0211 kristinx0211 added the s/verified Verified / Reproducible Issue ready for Engineering Triage label Mar 3, 2022
@kristinx0211
Copy link

verify repro Repro on Version 17.2.0 Preview 2.0 [32216.282.main] with the above project.

@hartez
Copy link
Contributor

hartez commented Mar 15, 2022

TitleView for Windows is in review: #5293.

That PR also makes the TitleView show up on Android.

@Redth Redth closed this as completed Mar 21, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Apr 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-navigation NavigationPage delighter high It doesn't work at all, crashes or has a big impact. platform/android 🤖 s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
No open projects
Status: Done
Development

No branches or pull requests

9 participants