iphone - 查看 Controller : Ladnscape to Portrait

标签 iphone ios ipad

我的应用程序中有一个 View Controller 。让它的第一个 View Controller ,我的第一个 View Controller 在手机中以纵向模式出现,当用户以横向模式旋转手机时,第一个 View Controller 也以横向模式旋转。

它工作正常,现在我在第一个 View Controller 上有一个按钮,当我触摸该按钮时,第二个 View Controller 出现。我只想做的是第二个 View Controller 应该始终以纵向模式出现,即使第一个 View Controller 处于横向模式。 是否有任何我必须重写才能获得此功能的方法?

最佳答案

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
   // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

在第二个 View Controller 中保留这个。

关于iphone - 查看 Controller : Ladnscape to Portrait,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14193916/

相关文章:

iphone - 应用程序因在第三代 iPad 上崩溃而被拒绝

ios - 如何以 00 :00:00 using AVFundation 格式打印音频时间

iphone - 如何在 Iphone 应用程序中创建日历?

iPhone 内存压力导致 iOS Keychain 数据丢失?

ios - Twitter 帖子中的自定义 URL 方案不起作用

ipad - 在 iPad 上绘制 2D Sprite 的 GL_BLEND 问题

iphone - 验证ipa并将其提交到AppStore,无需来源

ios - 跟踪用户位置与其他坐标之间的距离

ios - 在加载 tableView 时展开可选值时意外发现 nil

ios - 如何更改 uiscrollview ios 中滚动指示器的宽度?