iphone - UIInterfaceOrientation 随 Header 一起旋转

标签 iphone cocoa-touch uiinterfaceorientation

当我将模拟器从纵向旋转为横向时,标题不旋转。我想使用 UIInterfaceOrientation 随 View 旋转一起旋转标题。 enter image description here

最佳答案

@renuga 我认为你需要在 View Controller 中实现这个方法。

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
    if(toInterfaceOrientation == UIInterfaceOrientationLandscapeRight)
        return YES;
    if(toInterfaceOrientation == UIInterfaceOrientationPortrait)
        return YES;
    return NO;
}

转到 IB 并点击下面所示的箭头。

enter image description here

您需要调整标签栏的位置

关于iphone - UIInterfaceOrientation 随 Header 一起旋转,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5000718/

相关文章:

ios - 如何从推送 Controller 获取 RootViewController?

objective-c - 牢房?自定义 IOS TableView 单元格

ios - 进入 iPhone 应用程序。逆向工程 iPhone 应用程序

ios - Xcode:无法停止从子类播放 AVAudioPlayer 音乐

iphone - 如何在 UIButton 之间以编程方式获取 NSLayoutConstraint?

objective-c - 是否有用于与 SOAP Web 服务通信的 native iOS 解决方案?

ios - 不同的纵向和横向布局

ios - 用户启用/禁用旋转

iphone - 更改 UITableview 中多个开关的值