File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -55,10 +55,19 @@ public Task AddAsync(PopupPage page)
5555
5656 var renderer = page . GetOrCreateRenderer ( ) ;
5757
58- var window = new PopupWindow ( ) ;
59-
58+ PopupWindow window ;
6059 if ( IsiOS13OrNewer )
60+ {
61+ var connectedScene = UIApplication . SharedApplication . ConnectedScenes . ToArray ( ) . FirstOrDefault ( x => x . ActivationState == UISceneActivationState . ForegroundActive ) ;
62+ if ( connectedScene != null && connectedScene is UIWindowScene windowScene )
63+ window = new PopupWindow ( windowScene ) ;
64+ else
65+ window = new PopupWindow ( ) ;
66+
6167 _windows . Add ( window ) ;
68+ }
69+ else
70+ window = new PopupWindow ( ) ;
6271
6372 window . BackgroundColor = Color . Transparent . ToUIColor ( ) ;
6473 window . RootViewController = new PopupPlatformRenderer ( renderer ) ;
Original file line number Diff line number Diff line change @@ -20,6 +20,11 @@ public PopupWindow()
2020
2121 }
2222
23+ public PopupWindow ( UIWindowScene uiWindowScene ) : base ( uiWindowScene )
24+ {
25+
26+ }
27+
2328 public override UIView HitTest ( CGPoint point , UIEvent ? uievent )
2429 {
2530 var platformRenderer = ( PopupPlatformRenderer ? ) RootViewController ;
You can’t perform that action at this time.
0 commit comments