我目前正在设计一个应用程序,该应用程序从服务中提取地图数据,并将其呈现为MKMapView上的引脚。此外,我的应用程序是使用故事板设计的,其中每个场景都嵌入在导航控制器中。我正在处理的特性要求我让用户能够在给定结果集的地图视图和表视图之间切换。为了提供此功能,我在toolBar中包含了一个bar按钮项,当按下该按钮时,应该将当前视图翻转出来,并在其中添加第二个视图。
到目前为止,我一直在尝试以下代码,但没有结果:
MapListViewController *map = [[MapListViewController alloc]init];
[UIView beginAnimations:@"flip animation" context:nil];
[UIView setAnimationDuration:3.0];
[UIView setAnimationCurve:UIViewAnimationCurveLinear];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:map.view cache:YES];
[self.mapView removeFromSuperview];
[self.view addSubview:map.view];
[UIView commitAnimations];我最初是从here那里得到这种方法的,但它似乎对我没有用。
还有几件事要注意:
翻转视图转换只应更改当前显示在顶部和底部导航bars.
问题
我目前的实现有什么问题?它应该如何修改?
发布于 2012-03-30 04:49:04
我没有使用您的方法,但我确实实现了使用UIView类方法翻转一些视图。这是非常简单和直接的。有关其他选项,请参考文档。
[UIView transitionFromView:self.firstVC.view toView:self.secondVC.view duration:1.0 options:UIViewAnimationOptionTransitionFlipFromLeft completion:^(BOOL finished) {
// add any completion code here if needed.
}];发布于 2012-03-30 04:40:23
检查这个链接可能对你有帮助。
how to implement an iPhone view transition animation with both flipping and scaling?
希望它能帮到你。谢谢!!
发布于 2012-03-30 04:46:43
嗨,实现这样的东西会对你有帮助的。
推动使用这个..。
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1];
[navigationController pushViewController:viewController animated:NO];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:navigationController.view cache:NO];
[UIView commitAnimations];对于流行音乐,请使用这个
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1];
[navigationController popViewControllerAnimated:NO];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:navigationController.view cache:NO];
[UIView commitAnimations];https://stackoverflow.com/questions/9937053
复制相似问题