2009-08-23 3 views
0

iPhone 응용 프로그래밍 가이드는 "목록 2-1보기가있는 창 만들기"(아래 참조)라는 예제를 보여줍니다. 창에 두 개의 하위보기를 작성하고 추가하는 방법을 보여줍니다.아이폰 SDK - 여러 하위 뷰와 shouldAutorotateInterfaceOrientation

비슷한 패턴 =을 사용하고 있습니다. 이 올바르게 작동, 두 창 표시됩니다.

내가 겪고있는 문제는 인식하고 회전시키려는 것입니다. return 예를 수행하기 위해 shouldAutorotateInterfaceOrientation 메소드를 추가했습니다. 이들은 보입니다. 그러나 뷰 중 하나만 회전됩니다.

더 구체적으로 추가 할 마지막보기는 회전되고 이전보기는 회전하지 않습니다. 나는 둘 중 하나의 추가 서브 뷰로 회전 시켜서 회전시킬 수있다. 그러나 둘 다 회전 할 수는 없습니다. (아이폰 시뮬레이터에서 테스트)

두 뷰를 올바르게 회전시키는 데 필요한 것에 대한 제안 사항은 무엇입니까?

사과 샘플 코드입니다.

이 질문에 포기했다
- (void)applicationDidFinishLaunching:(UIApplication *)application { 
    // Create the window object and assign it to the 
    // window instance variable of the application delegate. 
    window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 
    window.backgroundColor = [UIColor whiteColor]; 

    // Create a simple red square 
    CGRect redFrame = CGRectMake(10, 10, 100, 100); 
    UIView *redView = [[UIView alloc] initWithFrame:redFrame]; 
    redView.backgroundColor = [UIColor redColor]; 

    // Create a simple blue square 
    CGRect blueFrame = CGRectMake(10, 150, 100, 100); 
    UIView *blueView = [[UIView alloc] initWithFrame:blueFrame]; 
    blueView.backgroundColor = [UIColor blueColor]; 

    // Add the square views to the window 
    [window addSubview:redView]; 
    [window addSubview:blueView]; 

    // Once added to the window, release the views to avoid the 
    // extra retain count on each of them. 
    [redView release]; 
    [blueView release]; 

    // Show the window. 
    [window makeKeyAndVisible]; 
} 

답변

0

, 슬프게도 ... 나는 그것이 아이 패드 SDK에 문제가 많이 발생의 원인이되므로, 그 답을 찾을 싶어요 ... 강제 가로 모드에서 1 개 이상의 하위 뷰를 추가 하나의 회전 된보기 만 만듭니다. 혼란 스러울 정도로, 시스템에 뭔가 잘못되었습니다. ~ Natan.