diff options
author | ytn3rd <b.moore@4pilabs.com.au> | 2016-07-19 09:25:47 +1000 |
---|---|---|
committer | Jason Smith <jason.smith@xamarin.com> | 2016-07-18 16:25:47 -0700 |
commit | d1885b44657bb573f3b2aa00cf5e36ed03c41eaa (patch) | |
tree | 07cffafda054e0855448afdf70fed9ae2a1a5fa7 | |
parent | d1a8477233b28e6a20c6f5d4a75128ec2a05e6dc (diff) | |
download | xamarin-forms-d1885b44657bb573f3b2aa00cf5e36ed03c41eaa.tar.gz xamarin-forms-d1885b44657bb573f3b2aa00cf5e36ed03c41eaa.tar.bz2 xamarin-forms-d1885b44657bb573f3b2aa00cf5e36ed03c41eaa.zip |
ixed issues where you could not force rotation with a NavigationPage on iOS. (#254)
-rw-r--r-- | Xamarin.Forms.Platform.iOS/Renderers/NavigationRenderer.cs | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/Xamarin.Forms.Platform.iOS/Renderers/NavigationRenderer.cs b/Xamarin.Forms.Platform.iOS/Renderers/NavigationRenderer.cs index 9f2c2666..fcc37522 100644 --- a/Xamarin.Forms.Platform.iOS/Renderers/NavigationRenderer.cs +++ b/Xamarin.Forms.Platform.iOS/Renderers/NavigationRenderer.cs @@ -946,6 +946,40 @@ namespace Xamarin.Forms.Platform.iOS if (_navigation.TryGetTarget(out n)) n.UpdateToolBarVisible(); } + + public override UIInterfaceOrientationMask GetSupportedInterfaceOrientations() + { + IVisualElementRenderer childRenderer; + if (Child != null && (childRenderer = Platform.GetRenderer(Child)) != null) + return childRenderer.ViewController.GetSupportedInterfaceOrientations(); + return base.GetSupportedInterfaceOrientations(); + } + + public override UIInterfaceOrientation PreferredInterfaceOrientationForPresentation() + { + IVisualElementRenderer childRenderer; + if (Child != null && (childRenderer = Platform.GetRenderer(Child)) != null) + return childRenderer.ViewController.PreferredInterfaceOrientationForPresentation(); + return base.PreferredInterfaceOrientationForPresentation(); + } + + public override bool ShouldAutorotate() + { + IVisualElementRenderer childRenderer; + if (Child != null && (childRenderer = Platform.GetRenderer(Child)) != null) + return childRenderer.ViewController.ShouldAutorotate(); + return base.ShouldAutorotate(); + } + + public override bool ShouldAutorotateToInterfaceOrientation(UIInterfaceOrientation toInterfaceOrientation) + { + IVisualElementRenderer childRenderer; + if (Child != null && (childRenderer = Platform.GetRenderer(Child)) != null) + return childRenderer.ViewController.ShouldAutorotateToInterfaceOrientation(toInterfaceOrientation); + return base.ShouldAutorotateToInterfaceOrientation(toInterfaceOrientation); + } + + public override bool ShouldAutomaticallyForwardRotationMethods => true; } void IEffectControlProvider.RegisterEffect(Effect effect) |