2012-10-09 25 views

回答

2
-(void)goToPage{ 

//do stuff... 

// start the animated transition 
[UIView beginAnimations:@"page transition" context:nil]; 
[UIView setAnimationDuration:1.0]; 
[UIView setAnimationTransition:flipUp ? UIViewAnimationTransitionCurlUp : UIViewAnimationTransitionCurlDown forView:self.view cache:YES]; 

//insert your new subview 
//[self.view insertSubview:currentPage.view atIndex:self.view.subviews.count]; 

    // commit the transition animation 
    [UIView commitAnimations]; 
} 

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight); 
} 
1
UIView* view = viewController.view; 
view.frame = self.view.window.bounds; 
[UIView transitionWithView:self.view.window 
        duration:0.2 
        options:UIViewAnimationOptionTransitionCurlUp 
       animations:^(void) { 
        [self.view.window addSubview:view]; 
       } 
       completion:^(BOOL finished) { 
        [viewController.view removeFromSuperview]; 
        [viewController presentModalViewController:viewController 
                 animated:NO]; 
       }]; 
    enter code here