1.在AppDelegate中增長,這個方法能夠禁止橫屏
app
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window { return UIInterfaceOrientationMaskPortrait; }
2.在工程-->target-->general裏面找到Depolyment Info,裏面有個device o rientation,裏面第一個點上,其餘的都取消就是默認豎屏了code