在AppDelegate.m中加入下边方法
//禁止横屏
-(UIInterfaceOrientationMask)application:(UIApplication
*)application supportedInterfaceOrientationsForWindow:(UIWindow
*)window{
return UIInterfaceOrientationMaskPortrait;
return UIInterfaceOrientationMaskPortrait;
}