博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

xcode4.6 设置应用程序各方向支持

Posted on 2013-06-14 16:58  tao tao  阅读(119)  评论(0)    收藏  举报

刚开始接触IPhone开发,在使用xcode4.6开发应用程序时,如果需要设置应用程序支持所有的方向,需按照以下两个步骤进行:

1. 选中四个方向

2. 在Controller中添加以下代码

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation{
    return YES;
}

- (NSUInteger)supportedInterfaceOrientations{
    return UIInterfaceOrientationMaskAll;
}

至此才OVER.