orientation of react native app doesn't work correctly

1.1k Views Asked by At

The rotation of the app works in three of four cases. If I hold the ipad not edgewise with the home button at the bottom, the app adjusts correctly. But if I rotate the ipad in the edgewise (home button on bottom) position, the app remains in the last orientation. Thus the portrait view works correctly but just if the home button is on the top. Any ideas?

1

There are 1 best solutions below

2
On

Please, check the following answer https://stackoverflow.com/a/14057998/2382237

According to it, You should override this methods:

- (BOOL)shouldAutorotate {
    return YES;
}

- (NSUInteger)supportedInterfaceOrientations {
    return (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown);
}

Maybe it can help you to figure out what is wrong