简体   繁体   中英

autorotation exclusive to some view controllers

Ive been searching for an answer for this and cant find one, although I feel like its an easy question.

Is it possible to only allow rotation in one view controller? I'm writing an iphone game and I want to be able to rotate when the user is playing the game but not in the menus.

thanks for any help you may be able to offer

put this in your view controller

-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {

return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft );

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