Skip to content

Title not updated after OnAppearing for TabbedPage in NavigationPage #22899

@TWEESTY

Description

@TWEESTY

Description

The title of the navigation page is not updated if we set the title after the "OnAppearing" event. We only have the problem with the "TabbedPage", so we don't have it with a classic "ContentPage".
If we set the title inside the "OnAppearing" method, the title is well updated.

The problem exists at least with Android API 33 and 29.
Microsoft.Maui.Controls v8.0.40.

image

Steps to Reproduce

  1. Create a tabbed page in a navigation page
  2. For example, override the "OnAppearing" method inside the TabbedPage with
protected override void OnAppearing()
{
	base.OnAppearing();

    this.Title = "On Appearing Title";

    var timer = Dispatcher.CreateTimer();
    timer.Interval = TimeSpan.FromMilliseconds(2000);
    timer.Tick += (s, e) =>
    {
        MainThread.BeginInvokeOnMainThread(() =>
        {
            this.Title = DateTime.Now.ToString();
        });
    };
    timer.Start();
}

Expected : Firstly, the title is "On Appearing Title", then the title is updated every two seconds with the date
Actual : The title is "On Appearing Title", and it doesn't change

Link to public reproduction project repository

https://github.com/TWEESTY/MAUI_Issue_TabbedPage_Title

Version with bug

8.0.40 SR5

Is this a regression from previous behavior?

Yes, this used to work in Xamarin.Forms

Last version that worked well

Unknown/Other

Affected platforms

I was not able test on other platforms

Affected platform versions

Android 10, Android 13

Did you find any workaround?

No.

Relevant log output

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions