When I rotate screen in my App using iPhone it always stays in portrait and nothing changes. However it works fine for iPad. I can rotate it and orientation changes.
How to make my App change screen orientation in iPhone when I turn it?
In config.xml I have:
<preference name="Orientation" value="default" />
The only solution I could find is changing method shouldAutorotateToInterfaceOrientation in MainViewController.m inside cordova code:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
-- return [super shouldAutorotateToInterfaceOrientation:interfaceOrientation];
++ return true;
}
But this seems like an ugly solution to me and I would really like to find normal way of doing this.
Ideally, it would be good to have all orientations for iPad and for iPhone all except portraitUpsideDown, but I don't know if I'm even allowed to dream about it.
Does anybody else has similar problem with iPhone and cordova? I've been googling for days now and couldn't find anything except this hack in cordova code.