我有两个viewController:FirstViewController和SecondViewController
我制作一个动画,让视图从右到左。
我想在向右扫描SecondViewController时隐藏并显示FirstViewController
动画工作有代码
SecondViewController *secondViewController = [[SecondViewController alloc] initWithNibName:@"PlayListController" bundle:nil];
// Set up view2
secondViewController.view.frame = self.view.frame;
secondViewController.view.center = CGPointMake(self.view.center.x + CGRectGetWidth(self.view.frame), self.view.center.y);
[self.view.superview addSubview:secondViewController.view];
// Animate the push
[UIView beginAnimations: nil context: NULL];
[UIView setAnimationDelegate: self];
[UIView setAnimationDidStopSelector: @selector(pushAnimationDidStop:finished:context:)];
secondViewController.view.center = self.view.center;
self.view.center = CGPointMake(self.view.center.x - CGRectGetWidth(self.view.frame), self.view.center.y);
[UIView commitAnimations];
我添加了一个按钮来隐藏带有动画的视图,但它不起作用?
答案 0 :(得分:0)
警告:这是非标准用户界面。最好使用标准导航栏和后退按钮。