I am adding a view (lets say redView) to self.view in a view controller.
Now the problem is i want the page curl down animation when the redView is added.
Is it possible to get that ?
I am adding a view (lets say redView) to self.view in a view controller.
Now the problem is i want the page curl down animation when the redView is added.
Is it possible to get that ?
Sampath,
I do this in an app I am developing at the moment.
This is what I did and it works fine:
[self.view insertSubview:redView atIndex:0]
[UIView transitionWithView:self.view
duration:1.0
options:UIViewAnimationOptionTransitionCurlDown
animations:^{ [[[self.view subviews] objectAtIndex:1] removeFromSuperview];}
completion:NULL];
Hope it works for you.
Keith
if redView is subClass of UIViewController.
First method
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1.0];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlDown
forView:redView.view
cache:YES];
[self.view addSubview:redView.view];
[UIView commitAnimations];
Second Method
RedView *viewController = [[RedView alloc] initWithNibName:@"RedView" bundle:nil];
[viewController setModalTransitionStyle:UIModalTransitionStylePartialCurl];
[self presentModalViewController:viewController animated:YES];
if redView is subClass of UIView.
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1.0];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlDown
forView:redView
cache:YES];
[self.view addSubview:redView];
[UIView commitAnimations];