我有一個問題淡出我的子視圖。我沒有任何麻煩,只能淡化視野。子視圖淡入和淡出幫助
-(void)flipToReview {
ReviewViewController *reviewVariable = [[ReviewViewController alloc] initWithNibName:@"ReviewViewController" bundle:nil];
[self setReviewViewController:reviewVariable];
self.ReviewViewController.view.alpha =0;
[UIView beginAnimations:@"flipview" context:nil];
[UIView setAnimationDuration:0.3];
[UIView setAnimationCurve:UIViewAnimationCurveLinear];
[UIView setAnimationTransition:UIViewAnimationTransitionNone forView:_window cache:YES];
[reviewVariable release];
[self.window addSubview:self.ReviewViewController.view];
self.ReviewViewController.view.alpha =1;
[UIView commitAnimations];
}
-(void)flipBackFromReview {
// self.ReviewViewController.view.alpha = 1;
[UIView beginAnimations:@"trip" context:nil];
[UIView setAnimationDuration:0.3];
[UIView setAnimationCurve:UIViewAnimationCurveLinear];
[UIView setAnimationTransition:UIViewAnimationTransitionNone forView:_window cache:NO];
self.ReviewViewController.view.alpha = 0;
[self.ReviewViewController.view removeFromSuperview];
[UIView commitAnimations];
self.window.rootViewController = self.tabBarController;
[self.window makeKeyAndVisible];
[self.ReviewViewController.view setHidden:1];
NSLog(@"remove subview");
}
真棒!謝謝大家!! – BlockReader 2011-05-21 05:53:07