【问题标题】:How do I prevent an iPhone background image from rotating when the device orientation changes?当设备方向改变时,如何防止 iPhone 背景图像旋转?
【发布时间】:2010-03-31 04:54:49
【问题描述】:

我已将shouldAutorotateToInterfaceOrientation 设置为返回YES 以进行定位,但我注意到随着iPhone 旋转,背景也随之旋转,这是UIImageView。如何固定背景使其不旋转?

【问题讨论】:

    标签: objective-c iphone xcode orientation


    【解决方案1】:

    这似乎可以解决问题。我已经在横向模式下修复了所有内容。

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

    【讨论】: