-
Notifications
You must be signed in to change notification settings - Fork 337
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
[Bug] XCT:StatusBarEffect.Color clashes with Rg:Plugins.Popup on iOS #735
Comments
hi @maxchu92 I looked through the issue on XamarinCommunityToolkit, and Pictos has reached out. I can give this a look about. Thankyou for the example 👍 |
Hi @LuckyDucko Really appreciate the effort of you guys for checking this issue out! Thank you! |
Has there been any progress on this issue? I've recently switched over to using Rg.Plugins.Popup because it's much easier to work without out of the box than the XCT popup, but we need to use StatusBarEffect.Color and these app crashes are a real problem. |
Sorry this went off my radar as i have been focusing on MAUI I remember previously issues surrounding replacing the root navigation within a popup, some thoughts. Does opening a modal, then a popup, THEN replacing Application.current.mainpage help dodge the issue? Does the XCT matter in this scenario, or is it Application.Current.Mainpage? i'll give this a whirl in the repo provided |
@LuckyDucko thanks for looking into this. The only place I'm actually running into this issue (so far) is when I chain popups. On a record details page, I have a "delete" button that, when pressed, opens a popup to confirm that the user actually wants to delete the record. If the user clicks the "Confirm" button, I close the popup, make an API call, and then open another popup that tells the user if the delete was successful or not. Everything works fine up to this point but closing the second popup causes the iOS app to crash on some devices. |
I faced the same problem.
|
I found the reason that causes the application to crash. If I comment out the code below in the App.xaml file, then the application works fine. <Style TargetType="NavigationPage">
<Setter Property="BarBackgroundColor" Value="{DynamicResource BarBackgroundColor}" />
<Setter Property="BarTextColor" Value="{DynamicResource BarTextColor}" />
<Setter Property="xct:StatusBarEffect.Color" Value="{DynamicResource BarBackgroundColor}" />
<Setter Property="xct:StatusBarEffect.Style" Value="{AppThemeBinding Dark={x:Static xct:StatusBarStyle.LightContent}, Light={x:Static xct:StatusBarStyle.DarkContent}}" />
</Style>
<Style
ApplyToDerivedTypes="True"
TargetType="{x:Type ContentPage}">
<Setter Property="BackgroundColor" Value="{DynamicResource AppBackgroundColor}" />
<Setter Property="xct:StatusBarEffect.Color" Value="{DynamicResource BarBackgroundColor}" />
<Setter Property="xct:StatusBarEffect.Style" Value="{AppThemeBinding Dark={x:Static xct:StatusBarStyle.LightContent}, Light={x:Static xct:StatusBarStyle.DarkContent}}" />
</Style> Tested on iOS 17 |
Could this line of code be the problem? Since here the RootViewController is simply replaced and after the Popup closed, does not change back.
This could just lead to window?.RootViewController being null here |
Description
When replacing the
Application.Current.MainPage
with a page that hasxct:StatusBarEffect.Color
from aPopupPage
, an error withRootViewController
will occur on iOS. It was first occured to me when I was trying to reset the entire navigation stack, from a PopupPage, while I was navigating using Prism._navigationService.NavigateAsync("/NavigationPage/MainPage");
. I had reproduced this issue in both environment, Xamarin.Forms independently, and Xamarin.Forms + Prism.Forms. By changing theApplication.Current.MainPage
in a PopupPage, it will occur as well. This error will occur if I am trying to reset the navigation stack to a page with StatusBarEffect.Exception
Stack Trace
Link to Reproduction Sample
Xamarin.Forms Version
Xamarin.Forms + Prism.Forms Version
Steps to Reproduce
Expected Behavior
Navigation stack is reset and go to MainPage without any error.
Actual Behavior
Error occurs when stack is reset.
Basic Information
Version with issue:
v5.0.0.2401
v2.0.2
v2.1.0
v8.1.97
v8.0.76
Last known good version:
IDE:
Platform Target Frameworks:
Nuget Packages:
v1.7.3
v1.7.3
I had already create a bug report in XamarinCommunityToolkit repository as well.
The text was updated successfully, but these errors were encountered: