PageCurlUp in a Tab Bar Item
I have a three item Tab Bar which works fine. On occasion I need to switch to a view not from the Tab Bar item but via an IBAction (button press) instead. Again this works fine with [self.tabBarController setSelectedIndex:1]; I want to switch to this view however with a PageCurlUp transition effect. I use this to do it:
EstimateController *estimateView = [[EstimateController alloc] initWithNibName:@"EstimateController" bundle:nil];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1];
[UIView setAnimationTransition:UIViewAnimationTransitionCu rlUp forView:self.view cache:YES];
[self.view addSubview:estimateView.view];
[UIView commitAnimations];
This works fine except, it disables the Tab Bar item view controller where the IBAction (UIButton) is used to change the view. To get around this I have tried to combine both techniques (I know it's not the most elegant way but I can't find another .... unless you know different). So I have this:
EstimateController *estimateView = [[EstimateController alloc] initWithNibName:@"EstimateController" bundle:nil];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1];
[UIView setAnimationTransition:UIViewAnimationTransitionCu rlUp forView:self.view cache:YES];
[self.view addSubview:estimateView.view];
[UIView commitAnimations];
[self.tabBarController setSelectedIndex:1];
to change the view with a PageCurlUp transition followed immediately by a change view - to the same view - using the setSelectedIndex to reposition the Tab Bar item.
This doesn't work and I don't know why. Any ideas on how to get this to work or a better way of doing it?
Last edited by TrueScot; 09-19-2010 at 05:03 AM.
|