1.在AppDelegate中增加,这个方法可以禁止横屏
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window { return UIInterfaceOrientationMaskPortrait; }
2.在工程-->target-->general里面找到Depolyment Info,里面有个device o rientation,里面第一个点上,其他的都取消就是默认竖屏了