【问题标题】:How to show MapView options with flip animation?如何使用翻转动画显示 MapView 选项?
【发布时间】:2013-02-02 01:26:51
【问题描述】:

如何在 mapView 中显示带有底部动画翻转的选项?就像 iPhone 中的原始地图应用程序一样?像这样:

谢谢!!

【问题讨论】:

    标签: iphone objective-c ios mkmapview


    【解决方案1】:

    将底层视图呈现为模态控制器并使用过渡样式 - 部分卷曲。像这样:

    controller.modalTransitionStyle = UIModalTransitionStylePartialCurl;
    [self presentModalViewController:controller animated:YES];
    

    更新: 在 iOS6 中你应该这样做:

    SecondeViewController *nextView = [[SecondeViewController alloc] init];
    nextView.modalTransitionStyle = UIModalTransitionStylePartialCurl;
    [self presentViewController:nextView animated:YES completion:Nil];
    

    【讨论】:

    • 就这么简单吧?非常感谢人!!现在,当我使用这种过渡样式时,它几乎会一直向上翻页。无论如何我可以控制它翻转多少?并像上图一样在屏幕的一半处停止它?
    • 部分卷曲过渡检测视图的使用量。像平常一样创建辅助视图,但只将内容放在视图的下半部分。
    【解决方案2】:
    UIViewAnimationTransition transition = UIViewAnimationTransitionCurlUp;
    UIViewAnimationCurve curve = UIViewAnimationCurveEaseInOut;
    [UIView beginAnimations:@"anim" context:NULL];
    [UIView setAnimationCurve:curve];
    [UIView setAnimationTransition:transition forView:[self view] cache:YES];
    [UIView setAnimationDuration:1.0f];
    [UIView commitAnimations];
    

    【讨论】:

      猜你喜欢
      • 2015-07-27
      • 1970-01-01
      • 1970-01-01
      • 2013-04-08
      • 2011-09-02
      • 1970-01-01
      • 2019-01-16
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多