2010-12-07 48 views
0

我的应用程序有一个图像作为背景,如果我旋转设备,所有部件和旋转,但不是背景图像。shouldAutorotateToInterfaceOrientation和图像旋转

我的shouldAutorotateToInterfaceOrientation实施是直截了当:

// Override to allow orientations other than the default portrait orientation. 
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 
    // Return YES for supported orientations 
    return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); 
} 

任何提示?

问候, 萨沙

+0

该死!我的意思是:背景图像旋转,但不缩放。 – Sascha 2010-12-07 20:36:53

回答

0

你应该把图像中一个UIImageView,如果你想自动缩放。但我建议有两张照片适合两种不同的方向,并在代码之间进行切换。

+0

好吧,现在我看到了问题:self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@“karo_iphone.png”]];是否有另一种方法来设置没有模式的视图的背景颜色,但具有正确的缩放? – Sascha 2010-12-08 20:54:59