2010-12-07 50 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