Frage

I have a view with a subview in it. The subview will contain other views.

enter image description here

When the user clicks on the menu on the left side, the contents of the subview will be switched: the current view will be removed and a new one will be added.

I want to animate this with an effect similar to UIModalTransitionStyleFlipHorizontal. How can I do this, considering that it wont be a modal form (it wont cover the entire screen)?

War es hilfreich?

Lösung

self.currentView.userInteractionEnabled = NO;

[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.75];
[UIView setAnimationDelegate:self];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.currentView cache:YES];
[self.currentView removeFromSuperview];
[self.view addSubview:self.someOtherView];
[UIView commitAnimations];

self.view.userInteractionEnabled = YES;
self.currentView = self.someOtherView;
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top