Open tompi opened 6 years ago
If you haven't fixed this yet, I was able to get it working by adding the code:
[Export("application:supportedInterfaceOrientationsForWindow:")]
public UIInterfaceOrientationMask GetSupportedInterfaceOrientations(UIApplication application, IntPtr forWindow)
{
return Plugin.DeviceOrientation.DeviceOrientationImplementation.SupportedInterfaceOrientations;
}
to the AppDelegate
If you haven't fixed this yet, I was able to get it working by adding the code:
[Export("application:supportedInterfaceOrientationsForWindow:")] public UIInterfaceOrientationMask GetSupportedInterfaceOrientations(UIApplication application, IntPtr forWindow) { return Plugin.DeviceOrientation.DeviceOrientationImplementation.SupportedInterfaceOrientations; }
to the AppDelegate
Worked for me
This doesn't work for me in a Xamarin.Forms iOS app on my iPad. Android works fine. The method GetSupportedInterfaceOrientations never gets called. I pulled the repo and tried the sample app and it didn't work either (its not Xamarin.Forms). Is there something incompatible with certain iOS or Xamarin versions? Xamarin.Forms does not expose the ViewController so Not sure it that is related.
I faced the same issue on the iPad. In iPad we need to disable the split-screen feature, to lock the orientation. Set RequireFullScreen to in the Xamarin.iOS info.plist file.
Tried to use the nuget package without success, so I cloned the repo and started the sample app on an ipad with ios 11.3.1.
Screen rotates even if label says locked...
This is the case for both the samples-solution and the TestNugetDeviceOrientationPlugin