景观中的肖像

时间:2011-11-13 05:29:43

标签: iphone ios4 interface-builder

我正在使用Xcode 4中的界面构建器。我创建了一个480(w)x320(h)图像,用于我的应用程序的横向模式。在IB中,我将视图的方向设置为“风景”。我把我的图像放在视图上。我已将“支持的设备方向”设置为横向letf / right。我已经更改了info.plist以支持横向方向。

这是奇怪的部分:当我运行应用程序时,模拟器会以横向旋转/启动,但是,我的图像也以某种方式旋转90度,因此它看起来被裁剪,并且只占据屏幕的1/3左右

因此,为了简化说明,图像始终显示在视图的相反旋转中。我已经尝试删除.png文件并重新添加并执行“干净”而没有运气。有什么建议吗?

1 个答案:

答案 0 :(得分:1)

您应该修改所有视图控制器中的shouldAutorotateToInterfaceOrientation方法,该方法应该是横向的:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {  
    if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight) {  
        return YES;  
    } 
} 
相关问题