第一步
左侧项目栏里面找到RootViewController.mm
/ Override to allow orientations other than the default portrait orientation.
// This method is deprecated on ios6
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return UIInterfaceOrientationIsPortrait( interfaceOrientation ); //竖直
// return UIInterfaceOrientationIsLandscape( interfaceOrientation );
}
// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead
- (NSUInteger) supportedInterfaceOrientations{
#ifdef __IPHONE_6_0
//return UIInterfaceOrientationMaskAllButUpsideDown;
return UIInterfaceOrientationMaskPortrait;
#endif
}
找到上面这段就好了
第二步
点击项目 名称就是项目烂第一个然后找到 deployment info 这个栏目 把 Device Orientation里面得 Portrait 打上勾 ok了