dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
21.93k stars 1.7k forks source link

Shell TitleView not reliable #16015

Open williambuchanan2 opened 1 year ago

williambuchanan2 commented 1 year ago

Description

If you add content to a Shell.TitleView it sometimes (50%) doesn't display.

E.g.

<Shell.TitleView>
    <Image Source="edit.png" Aspect="AspectFit" HorizontalOptions="Start" VerticalOptions="Center" />
</Shell.TitleView>

As you navigate around, it will sometimes display ok and other times it won't show. It is random - even on the same page it will sometimes show or not show.

On iOS it is even worst - it just doesn't show at all.

Here it is working on page 1:

image

Here it is not working on page 2:

image

Back on page 2 and now it shows: image

Steps to Reproduce

Open app from repo below. Notice icon appears on top of page Switch to other tabs and notice it disappears occsaionally. Notice that switching back to tabs which didn't show the icon sometimes show it, and vice versa. In this app it seems to be every alternate click it switches, so to see the problem on page 2, follow this sequence:

Link to public reproduction project repository

https://github.com/williambuchanan2/MauiShell

Version with bug

7.0.86

Last version that worked well

Unknown/Other

Affected platforms

iOS, Android

Affected platform versions

Android 11 - 13, iOS 16

Did you find any workaround?

No

Relevant log output

No response

BrianEnee commented 1 year ago

I'm facing a similar issue. If I navigate back and forth, some elements disappear from the Shell TitleView.

Grzesik commented 1 year ago

Hi, I described the bug also here: [https://github.com/dotnet/maui/issues/13916]. I've been waitig for 2 months now with my updated app to .Net MAUI, but with this bug it is not possible. :-(

williambuchanan2 commented 1 year ago

Unfortunately there are a lot of more critical issues which have been reported over 2 years ago that haven't been addressed, so my only advice is look for a workaround because not much is getting fixed in Maui.

UkeHa commented 1 year ago

On iOS there's also a delay when using shell in showing the title. The animation first loads all the content and then updates the title of the page with a delay of approximately 500ms

samhouts commented 11 months ago

@williambuchanan2 The reproduction project doesn't build for me. Do you have a simpler sample? Thanks!

ghost commented 11 months ago

Hi @williambuchanan2. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

williambuchanan2 commented 11 months ago

I have updated the project. Can you pull the changes down and see if it builds now? The project is already a simple sample - there isn't much code in there. If you have problems building again can you let me know what error you are getting? Thanks

michaelonz commented 10 months ago

Im also experiencing this issue - on both iOS and android..there is definitely issues around shell.title view when you have shell tabs (in my case I have bottom and top tabs)

SliemBeji-FBC commented 9 months ago

Facing the same issue. We need a fix

Zhanglirong-Winnie commented 6 months ago

Verified this issue with Visual Studio Enterprise 17.9.0 Preview 4. Can repro on android and iOS platforms with sample project. https://github.com/williambuchanan2/MauiShell

omer-ays commented 2 months ago

It's 2024 and it's still hard to understand these strange mistakes of the maui platform. The imagebuttons I put in Shell.TitleView on the Android platform work correctly, but not on iOS. When I change the theme of the app from dark to light, the buttons appear. It is very strange.

michaelonz commented 2 months ago

@omer-ays - are you changing the icon color based on theme? (Are you sure you don't have a dark icon on a dark background or vica versa.) I have icons working in my app for light and dark themes.

omer-ays commented 2 months ago

@omer-ays - are you changing the icon color based on theme? (Are you sure you don't have a dark icon on a dark background or vica versa.) I have icons working in my app for light and dark themes.

interestingly it started working smoothly. Strange.