I have two components. One of them (B) locks to portrait and the other one (A) -- to landscape right.
If I want to lock the orientation and also make sure that interface is autorotated, I lock orientation to opposite value first:
Orientation.lockToPortrait()
Orientation.lockToLandscapeRight()
Add this
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
before calling
[[UIDevice currentDevice] setValue: ];
and
while ([[UIDevice currentDevice] isGeneratingDeviceOrientationNotifications]) {
[[UIDevice currentDevice] endGeneratingDeviceOrientationNotifications];
}
before
return [Orientation getOrientation];
in AppDelegate's application supportedInterfaceOrientationsForWindow
@thehappycoder make a PR :D
As I saw there were no PR for this issue, I got the solution from @thehappycoder and created one. Hope you don't mind..! The pull request is the #247.
I still get this issue on 3.1.3. First workaround works
Most helpful comment
Alternative workaround (which is better in my case)
Add this
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];before calling
[[UIDevice currentDevice] setValue: ];and
before
return [Orientation getOrientation];in AppDelegate's application supportedInterfaceOrientationsForWindow