UIInterfaceOrientation景观与Xcode 5中的肖像问题
我觉得我几乎已经在这个话题的每一个职位。 所以,不要把这个问题杀死,直到你阅读。 这个问题是针对iOS 7上的XCode 5的
我有一个支持横向和纵向模式的应用程序。 在我的项目部署信息所有的方向进行检查。
当应用程序启动我显示
- v1ViewController(总是应该以横向模式打开)
当一个用户点击一个button时,他们会把他们带到
- v3ViewController(它总是应该以纵向模式打开)
我有的问题是,当应用程序启动,我拿着肖像模式的iPhone显示这一点。
如果我在横向模式下切换iphone,就会显示出来。
我如何强制我的v1ViewController始终显示风景模式?
这是我现在的代码。
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight) { return YES; } else { return NO; } }
但是,如果我添加这个,然后视图总是像我显示的第一张照片打开和旋转没有效果。
- (BOOL)shouldAutorotate { UIInterfaceOrientation interfaceOrientation = [[UIApplication sharedApplication] statusBarOrientation]; NSLog(@"interfaceOrientation: %d ...", interfaceOrientation); if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft) { return YES; } else if (interfaceOrientation == UIInterfaceOrientationLandscapeRight) { return YES; } else { return NO; } } - (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { return UIInterfaceOrientationLandscapeLeft; } -(NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationLandscapeLeft | UIInterfaceOrientationLandscapeRight; }
对于任何对我如何工作感兴趣的人,这就是我所做的。
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return UIInterfaceOrientationIsLandscape(interfaceOrientation); } -(NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskLandscape; } - (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { return UIInterfaceOrientationLandscapeLeft; }
- itunes使用应用程序加载器在防火墙后面连接
- 找不到添加到xcode 7的自定义字体的名称
- 响应UIWebView单击操作来调用本机代码页
- 在SearchBar点击显示UISearchController的SearchResultsController
- 当我将图像设置为IBImageView时,生成失败
- 在iOS和Android上跨平台使用静态.a-library可能吗? (那么.so和.dylib呢?)
- 在设备上将GIF转换为MP4
- 在NSMutableArray中使用BOOL对象来确定单元状态
- Swift 3:DispatchQueue.main.async {}和DispatcQueue.main.async之间的区别(execute:{})?