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

답변

0

당신은있는 UIImageView에서 이미지를 넣어해야합니다. 그러나 두 개의 다른 방향에 맞는 두 개의 그림을 적절히 배치하고 코드 사이를 전환하는 것이 좋습니다.

+0

아, 이제 문제가 생겼습니다. self.view.backgroundColor = [UIColor colorWithPatternImage : [UIImage imageNamed : @ "karo_iphone.png"]]; 패턴이없는 뷰의 배경색을 설정하는 또 다른 방법이 있습니까? – Sascha

관련 문제