2010-12-07 27 views
0

私のデバイスには、デバイスを回転させると、すべてのウィジェットと回転はありますが、背景の画像はありません。 shouldAutorotateToInterfaceOrientationshouldAutorotateToInterfaceOrientationと画像の回転

私の実装は単純です:

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

任意のヒント?

よろしく、 サシャ

+0

Damned!つまり、背景画像は回転しますが、縮尺は変わりません。 – Sascha

答えて

0

あなたは自動スケーリングをしたい場合は、UIImageViewに画像を配置する必要があります。しかし、私は、2つの異なる方向のために適切な大きさの2つの画像を用意し、コード間で切り替えることをお勧めします。

+0

ああ、今問題が表示されます:self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@ "karo_iphone.png"]];パターンなしでビューの背景色を設定する別の方法がありますが、正しいスケーリングがありますか? – Sascha