This is likely because UIDeviceOrientationLandscapeRight is assigned to UIInterfaceOrientationLandscapeLeft and UIDeviceOrientationLandscapeLeft is assigned to UIInterfaceOrientationLandscapeRight.
The reason for this is that rotating the device requires rotating the contents in the opposite direction.
Starting with iOS 8, you should use the UITraitCollection and UITraitEnvironment APIs, as well as the size class properties used in these APIs, instead of using UIInterfaceOrientation constants or otherwise writing the application in terms of interface orientation.
Anyway, orientation in this way worked for me.
var orientation = UIApplication.SharedApplication.StatusBarOrientation; switch (orientation) { case UIInterfaceOrientation.PortraitUpsideDown:
We also consider that
If your application has rotatable content, you should not arbitrarily set the state-bar orientation using this method. The frame-state orientation set by this method does not change if the device orientation changes.
source share