Skip to content

[Android] Shell TitleView's child elements are cleared too early #30834

@bhavanesh2001

Description

@bhavanesh2001

Description

When using <Shell.TitleView> in a .NET MAUI Android application, defining a layout with child elements (such as a Grid containing a Label and a Button) causes the child elements to be cleared immediately upon navigating back using the Shell back button.

Slowed down video:

titleview.mp4

Steps to Reproduce

  1. Define a Shell.TitleView in XAML:
    <Shell.TitleView>
        <Grid ColumnDefinitions="*,*">
            <Label Text="New Page" />
            <Button Grid.Column="1" Text="Demo button" />
        </Grid>
    </Shell.TitleView>
  2. Navigate to the page where this TitleView is used.
  3. Press the Shell back button to return to the previous page.
  • Expected outcome: The TitleView's child elements should persist and not be cleared after navigating back.
  • Actual outcome: On Android, the child elements of the TitleView are cleared immediately after navigating back.

Link to public reproduction project repository

https://github.com/bhavanesh2001/maui-bugs/tree/shell_title_view

Version with bug

9.0.90 SR9

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions