ios - iPhone/iPad iOS7 中的设备方向问题

标签 ios iphone objective-c ipad

在我的应用程序中,我同时使用 iPhone 和 iPad。现在的主要问题是设备方向。我想同时使用纵向和横向。但是当我向右或向左旋转时,我得到了这种类型的 View ,如下所示。

另外,当我打开自动布局选项检查时,我也发现了这样的新图像。

When turned on autolayout

This is original image

this when landscape

我使用 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;
}

最佳答案

Properties

根据您的需要更改属性..

你想放大或者你想放在别处.. ..

关于ios - iPhone/iPad iOS7 中的设备方向问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22060706/

相关文章:

iphone - TableView Footer 随表格滚动

ios - 使用 CAShapeLayer 创建 UIActivityIndi​​cator 动画

ios - 嵌入到选项卡栏 Controller 偏移 TableView

iphone - 使用 setValue : forKey: with an int 时,CoreData 为实体插入新对象时出现错误

ios - 将 CLBeacon 设置为 nil 时的 EXC_BAD_ACCESS

iphone - UIView 动画不适用于开始在 iPhone 应用程序中编辑文本

iphone - 即使应用程序在后台运行且未打开,WhatsApp 如何知道用户是否收到推送通知?

ios - 如何使 Objective-C 类符合 Swift 中定义的协议(protocol)?

ios - @synchronization 但只有一次

ios - 警报 View 没有确定/关闭按钮?