Open Marc-Antoine-Soucy opened 2 years ago
I have a feeling that this may be happening because of the Content being set to a FrameworkElement instead of just a string. If you were to TemplateBind the CommandBarTitle directly to the CommandBar.Content property does the issue still occur?
We have to basically force the custom view for the title to have its parent be the CommandBar instead of the native view. I'm thinking that we're not maintaining that relationship somewhere so the binding breaks
@kazo0 So, I tried it and the title does indeed stop disappearing. Only thing I'm not 100% about is how to change the style of the title. Is there some style I can override to change it?
@Marc-Antoine-Soucy no :) you're pretty much stuck with the native iOS look of the title.
"When Content is a string, it's displayed using the platform's default font family, font size, font style and text alignment. Only the foreground color can be changed, using Foreground" https://platform.uno/docs/articles/controls/CommandBar.html#content
I am looking into the issue, hopefully we can get the custom Content working properly again soon
Alright, thanks
I have a bad feeling it has to do with the fix from here: https://github.com/unoplatform/uno/issues/7012
Maybe not, it seems that the view is still actually present in the CommandBar, it's just empty since the TemplateBinding looks to be broken. If we use just a regular Binding to some string in the PageLayout's DataContext, it will still be there after GC.
I'll have to keep digging to see why the TemplateBinding isn't working
We may need to force an strong reference to some views and not rely on the CommandBar proxy's storage.
@Marc-Antoine-Soucy
I am no longer able to reproduce this in your sample app, nor in the one I created here: GcCommandBar.zip
Maybe this doesn't occur in later version of iOS? Can you confirm on your end that this is no longer an issue?
@kazo0 I tried it on 16.x versions of IOS and it was fixed, so It does seem to be fixed on later versions of IOS. But, it still happens on IOS 14.3 simulator.
@Marc-Antoine-Soucy
Ah interesting, is this still a high priority or is your client not going to be targeting the affected versions of iOS?
@takla21 mentioned that this issue is of high priority for an upcoming scenario.
@takla21 This is still happening on latest iOS versions or is it a blocker for iOS 14 and below?
@kazo0 So I went ahead and updated the sample to latest and test whether it was still happening and it seems to happen on ios 14 & 15. However, on IOS 16 it seems fixed (iPhone SE iOS 16.5)
Here's the updated sample CommandBarSample.zip
Curious if the same occurs with NavigationBar from Toolkit, I would imagine so
Current behavior
When the commandbar has it's title linked to a templatebinding and you navigate to another page, trigger the garbage collector, and then go back, the title is gone.
Expected behavior
The title should not disappear.
How to reproduce it (as minimally and precisely as possible)
Open the app, navigate to the next page, click on the garbage collector button Navigate back Notice Title disappeared CommandBarOffset (1).zip
Workaround
Works on UWP/WinUI
Yes (the bug is not present in UWP)
Environment
Uno.UI / Uno.UI.WebAssembly / Uno.UI.Skia, Uno.UI.RemoteControl / Uno.WinUI.RemoteControl
NuGet package version(s)
Affected platforms
IOS
IDE
Visual Studio 2022
IDE version
Version 17.2.5
Relevant plugins
none
Anything else we need to know?
I made this sample from another sample that only had android/ios/uwp. I will try to put all the platforms in my samples in the future.