我只是想知道我们应该如何处理iPhone 5更大的屏幕尺寸.
因为它有更多像素的高度,像GCRectMake这样使用坐标(并且只是将像素与视网膜/非视网膜问题加倍)之类的东西将无法在版本之间无缝地工作,就像我们获得Retina时那样.
我们是否必须设计两个故事板,就像iPad一样?
我个人认为Apple不会要求你每次必须画一些东西来检查屏幕大小,就像许多答案所说的那样.这会发生在iPad上吗?
在iOS6中,shouldAutorotateToInterfaceOrientation已弃用.我尝试使用 supportedInterfaceOrientations和shouldAutorotate 使应用程序正常工作自动旋转但失败了.
这个ViewController我不想旋转,但它不起作用.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
-(BOOL)shouldAutorotate
{
return NO;
}
-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskPortrait;
}
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?在此先感谢您的帮助!
看起来avcapturevideopreviewlayer的方向已在iOS 6中折旧.任何人都知道新代码?这是我目前的(折旧)代码:
[self setPreviewLayer:[[AVCaptureVideoPreviewLayer alloc] initWithSession:[self captureSession]]];
[[self previewLayer] setVideoGravity:AVLayerVideoGravityResizeAspectFill];
previewLayer.orientation = UIInterfaceOrientationLandscapeRight;
Run Code Online (Sandbox Code Playgroud) 这不是一个重复的问题.尚未提供最终工作解决方案.在我接受答案或找到并提供我自己的解决方案之前,请不要关闭此问题.谢谢!
================================================== ================使用Xcode 4.5.1,我有一个标签栏应用程序,里面有5个标签.每个选项卡都包含一个UINavigationController.因此,整个应用程序需要在纵向模式下查看,除了一个唯一的ViewController - 一个"模态"VC,它以全屏模式打开,并且打算在横向模式下查看.
这在iOS5中运行得非常好 - 我只是在一个特定的ViewController中使用了以下代码:
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}
Run Code Online (Sandbox Code Playgroud)
但现在应用程序崩溃了,并给出了这个错误:
Terminating app due to uncaught exception 'UIApplicationInvalidInterfaceOrientation',
reason: 'preferredInterfaceOrientationForPresentation must return a supported interface orientation!'
Run Code Online (Sandbox Code Playgroud)
有什么建议?