简体   繁体   中英

Orientation not changing on device

I have supported both LandscapeLeft and landscapeRight directions

-(NSUInteger)supportedInterfaceOrientations
{

     return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationLandscapeRight;
}

But the orientation is not changing for landscapeRight. I have added observer to detect the orientation change events, those events are being called but the statusBar and navigation bar do not change for landscapeRight mode.

Add

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
    UIInterfaceOrientationIsLandscape(toInterfaceOrientation);
}

You've got TYPO Instead of

UIInterfaceOrientationMaskLandscapeRight

you've got

UIInterfaceOrientationLandscapeRight

Check if you have checked it orientation support on your project setting. 设置项目导向支持 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM