How do I uncurl after a partial curl animation?

2019-05-26 20:12发布

问题:

I am doing a partial page curl in this way:

- (IBAction)settings:(id)sender {

    Settings *go = [[[Settings alloc] initWithNibName:@"Settings" bundle:nil] autorelease];
    go.modalTransitionStyle = UIModalTransitionStylePartialCurl;
    [self presentModalViewController:go animated:YES];
}

How do I uncurl this animation?

回答1:

Just dismiss the modal view controller as you always do. iOS will take care of the transition as you have already specified the modalTransitionStyle.

[self dismissModalViewControllerAnimated:YES];


回答2:

-(IBAction)backClicked{
    [self dismissModalViewControllerAnimated:YES];
}


回答3:

Also you can try to tap on left top corner with part of curl page to automatically dismiss view controller.



回答4:

Information for > ios 6.0:
dismissModalViewControllerAnimated is deprecated now.

The new method it´s without "modal", looks like that:

[self dismissViewControllerAnimated:YES completion:nil];