3

私のアプリでは、TTphotoView を使用しようとしているので、ViewController では、次のように、navigationController で TTphotoView をプッシュします。



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 でデバイスを回転させても何も起こらないことです。

編集:人々が同じ問題を抱えていなかったとは信じられません。アプリケーションで、TTNavigation ではなく、自分のナビゲーションで photoView を使用している場合、ViewController をどのようにプッシュしたか教えてもらえますか?

4

3 に答える 3

2

私も同じ問題を抱えていました。

理由はわかりませんが、three20コードのTTScrollView deviceOrientationDidChangeメソッドがコメント化されています!コメントを外すと機能します。

ここのコードを参照してください:http://github.com/facebook/three20/blob/master/src/TTScrollView.m

于 2010-03-24T09:49:54.477 に答える
0

willcodejavaforfoodに対する私のコメントです。たとえば、次のようなことを行うことで強制できますが、内部に問題が多すぎます。three20 の PhotoViewController は自分でそれを行う必要があるため、それは望ましくありません。



- (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];

    }
}

于 2010-02-12T10:44:51.357 に答える
0

アプリケーションの次のものをオーバーライドしましたか?

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation

横向きの場合は YES を返しますか?

于 2010-02-12T09:10:03.103 に答える