2012-04-04 71 views

回答

5

写在你的UIViewController

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 
    if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) 
     return UIInterfaceOrientationIsPortrait(interfaceOrientation); 
    else 
     return UIInterfaceOrientationIsLandscape(interfaceOrientation); 
} 
+0

嗯我以前见过这个userInterfaceIdiom。只是从来没有想过会是这样。太好了,谢谢 – 2012-04-04 18:27:06

相关问题