summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Xamarin.Forms.Platform.MacOS/ModalPageTracker.cs13
-rw-r--r--Xamarin.Forms.Platform.MacOS/PlatformNavigation.cs2
-rw-r--r--Xamarin.Forms.Platform.MacOS/PlatformRenderer.cs1
3 files changed, 16 insertions, 0 deletions
diff --git a/Xamarin.Forms.Platform.MacOS/ModalPageTracker.cs b/Xamarin.Forms.Platform.MacOS/ModalPageTracker.cs
index c492f4cd..c02c64e0 100644
--- a/Xamarin.Forms.Platform.MacOS/ModalPageTracker.cs
+++ b/Xamarin.Forms.Platform.MacOS/ModalPageTracker.cs
@@ -41,6 +41,19 @@ namespace Xamarin.Forms.Platform.MacOS
return HideModalAsync(modal, animated);
}
+ internal void LayoutSubviews()
+ {
+ if (_renderer == null || _renderer.View == null)
+ return;
+
+ foreach(var modal in _modals)
+ {
+ var modalRenderer = Platform.GetRenderer(modal);
+ if(modalRenderer != null)
+ modalRenderer.SetElementSize(new Size(_renderer.View.Bounds.Width, _renderer.View.Bounds.Height));
+ }
+ }
+
public void Dispose()
{
Dispose(true);
diff --git a/Xamarin.Forms.Platform.MacOS/PlatformNavigation.cs b/Xamarin.Forms.Platform.MacOS/PlatformNavigation.cs
index 7af8f074..13846b6c 100644
--- a/Xamarin.Forms.Platform.MacOS/PlatformNavigation.cs
+++ b/Xamarin.Forms.Platform.MacOS/PlatformNavigation.cs
@@ -18,6 +18,8 @@ namespace Xamarin.Forms.Platform.MacOS
_animateModals = true;
}
+ public ModalPageTracker ModalPageTracker => _modalTracker;
+
public IReadOnlyList<Page> ModalStack => _modalTracker.ModalStack;
public IReadOnlyList<Page> NavigationStack => new List<Page>();
diff --git a/Xamarin.Forms.Platform.MacOS/PlatformRenderer.cs b/Xamarin.Forms.Platform.MacOS/PlatformRenderer.cs
index c0fcae35..97c44a08 100644
--- a/Xamarin.Forms.Platform.MacOS/PlatformRenderer.cs
+++ b/Xamarin.Forms.Platform.MacOS/PlatformRenderer.cs
@@ -28,6 +28,7 @@ namespace Xamarin.Forms.Platform.MacOS
{
base.ViewDidLayout();
Platform.LayoutSubviews();
+ _platformNavigation?.ModalPageTracker?.LayoutSubviews();
}
public override void ViewWillAppear()