public void SetOrientation(EDeviceOrientations orientation) { switch (orientation) { case EDeviceOrientations.Landscape: ((MainActivity)_context).RequestedOrientation = Android.Content.PM.ScreenOrientation.Landscape; break; case EDeviceOrientations.Portrait: ((MainActivity)_context).RequestedOrientation = Android.Content.PM.ScreenOrientation.Portrait; break; } }
public void SetOrientation(EDeviceOrientations orientation) { switch (orientation) { case EDeviceOrientations.Landscape: UIDevice.CurrentDevice.SetValueForKey(new NSNumber((int)UIInterfaceOrientation.LandscapeLeft), new NSString("orientation")); break; case EDeviceOrientations.Portrait: UIDevice.CurrentDevice.SetValueForKey(new NSNumber((int)UIInterfaceOrientation.Portrait), new NSString("orientation")); break; } //UIDevice.CurrentDevice.SetValueForKey(newNSNumber((int)UIInterfaceOrientation.LandscapeLeft), new NSString("orientation")); }