在我的应用程序中,我同时使用 iPhone 和 iPad。现在的主要问题是设备方向。我想同时使用纵向和横向。但是当我向右或向左旋转时,我得到了这种类型的 View ,如下所示。
另外,当我打开自动布局选项检查时,我也发现了这样的新图像。
我使用 firstViewController 并且我放置了方向方法,当我在上面放置断点时,它没有被调用,这是我的代码:
在 fVC.m 中:
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
if (interfaceOrientation == UIDeviceOrientationLandscapeLeft || interfaceOrientation == UIDeviceOrientationLandscapeRight)
{
if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone) {
locationBtn.frame = CGRectMake(200,200,86,86);
cameraBtn.frame = CGRectMake(200,200,86,21);
}
else
{
locationBtn.frame = CGRectMake(200,200,86,86);
cameraBtn.frame = CGRectMake(230,200,86,21);
}
}
return 0;
}
最佳答案
根据您的需要更改属性..
你想放大或者你想放在别处.. ..
关于ios - iPhone/iPad iOS7 中的设备方向问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22060706/