2010-02-12 3 views
3

는 내가의 ViewController에서이 같은 내있는 navigationController으로 TTphotoView을 밀어 있도록 TTphotoView를 사용하려고하지 TTPhotoView :TTThumbView/아니오 자동 회전 내 응용 프로그램에서



if(self.photoViewController == nil { 

    PhotoViewController *viewController = [[PhotoViewController alloc] init]; 
    self.photoViewController = viewController; 
    viewController.hidesBottomBarWhenPushed = YES; 
    [viewController release]; 
} 
[self.navigationController pushViewController:self.photoViewController animated:YES]; 
[self.navigationController  dismissModalViewControllerAnimated:YES] 


사용자가에서 장치를 회전 할 때 문제가 PhotoViewController 아무 일도 일어나지 않습니다.

편집 : 나는 사람들이 똑같은 문제를 겪지 않았다는 것을 믿을 수 없다. 누군가 자신의 내비게이션으로 자신의 응용 프로그램에서 photoView를 사용하고 TT 탐색이 아니라면 그는 ViewController를 어떻게 밀어 냈는지 말할 수 있습니다.

답변

0

당신은 응용 프로그램의 재정의 :

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 

및 가로 방향에 대해 YES를 반환? 내가 예를 들어이 있지만, 너무 많은 문제에 대한 내부 뭔가를 수행하여 강제 할 수 있으며, three20의 PhotoViewController 자신에 의해 그것을 수행해야 당신에게로

+0

예 이미 작성했습니다. 내 UiNavigationcontroller 또는 UITbabBarController 문제가 될 수 있습니다 또는 아닙니다? – ludo

+0

그래서 PhotoViewController가 shouldAutoRotateToInterfaceOrientation을 재정의합니까? 그렇다면 부모보기가 필요하다고 생각하지 않습니다. – willcodejavaforfood

+0

네, 어쩌면 그것을 무시하지만 확실하지 않습니다. 나는 정말로 그 문제가 무엇인지 모른다. 나는 내 2 번째 대답에서 당신을 보여줄 로테이션을 강요 할 수 있지만, 모든 것을 너무 많은 문제가 있기 때문에 이것을하고 싶지는 않습니다. – ludo

0

willcodejavaforfood에 대한 나의 의견은, 그래서 나는 원하지 않는다 :



- (void)viewWillAppear:(BOOL)animated { 
    [super viewWillAppear:animated]; 

[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; 
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receivedRotate:) name:UIDeviceOrientationDidChangeNotification object:nil]; 
} 


-(void) receivedRotate: (NSNotification *) notification { 

    NSLog(@"ORIENTATION CHANGE"); 
    UIDeviceOrientation interfaceOrientation = [[UIDevice currentDevice] orientation]; 

    if(interfaceOrientation == UIDeviceOrientationLandscapeRight) { 

     [UIView beginAnimations:@"View Flip" context:nil]; 
     [UIView setAnimationDuration: 0.5f]; 
     [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; 

     self.view.transform = CGAffineTransformIdentity; 
     self.view.transform = CGAffineTransformMakeRotation(-M_PI/2); 
     self.view.bounds = CGRectMake(0.0, 0.0, 480.0, 320.0); 

     self.view.center = CGPointMake(240.0f, 160.0f); 
     [UIView commitAnimations]; 

    } 
} 

2

나는 동일한 문제가있었습니다.

왜 그런지 모르지만 320 코드의 TTScrollView deviceOrientationDidChange 메소드가 주석 처리되었습니다. 주석 처리를 제거하면 작동합니다.

여기에서 코드를 참조하십시오. http://github.com/facebook/three20/blob/master/src/TTScrollView.m

+0

내 코드에서 주석에 없다고 생각하기 때문에이 코드를 살펴 봐야 할 것입니다. 하지만 내 문제는 TabBar에 있었고, TabBar가 내 응용 프로그램에서 회전 할 수있게해야했습니다. – ludo