相关疑难解决方法(0)

iOS 6应用程序 - 如何处理iPhone 5屏幕尺寸?

可能重复:
如何为iPhone 5屏幕分辨率开发或迁移应用程序?

我只是想知道我们应该如何处理iPhone 5更大的屏幕尺寸.

因为它有更多像素的高度,像GCRectMake这样使用坐标(并且只是将像素与视网膜/非视网膜问题加倍)之类的东西将无法在版本之间无缝地工作,就像我们获得Retina时那样.

我们是否必须设计两个故事板,就像iPad一样?

我个人认为Apple不会要求你每次必须画一些东西来检查屏幕大小,就像许多答案所说的那样.这会发生在iPad上吗?

iphone ios iphone-5

264
推荐指数
6
解决办法
16万
查看次数

如何使应用程序在iOS 6中完全正常工作以进行自动旋转?

在iOS6中,shouldAutorotateToInterfaceOrientation已弃用.我尝试使用 supportedInterfaceOrientationsshouldAutorotate 使应用程序正常工作自动旋转但失败了.

这个ViewController我不想旋转,但它不起作用.

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

-(BOOL)shouldAutorotate
{
    return NO;
}

-(NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskPortrait;
}
Run Code Online (Sandbox Code Playgroud)

有任何想法吗?在此先感谢您的帮助!

uiviewcontroller autorotate ios ios6

17
推荐指数
1
解决办法
2万
查看次数

iOS 6中不推荐使用方向

看起来avcapturevideopreviewlayer的方向已在iOS 6中折旧.任何人都知道新代码?这是我目前的(折旧)代码:

[self setPreviewLayer:[[AVCaptureVideoPreviewLayer alloc] initWithSession:[self captureSession]]];
[[self previewLayer] setVideoGravity:AVLayerVideoGravityResizeAspectFill];
previewLayer.orientation = UIInterfaceOrientationLandscapeRight;
Run Code Online (Sandbox Code Playgroud)

iphone

5
推荐指数
1
解决办法
5272
查看次数

iOS 6在设备轮换时崩溃

这不是一个重复的问题.尚未提供最终工作解决方案.在我接受答案或找到并提供我自己的解决方案之前,请不要关闭此问题.谢谢!

================================================== ================使用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)

有什么建议?

iphone orientation device-orientation ios6

-1
推荐指数
1
解决办法
2084
查看次数