如何设置不隐藏工具栏的部分curl模式?

在iPhone上的Google地图应用程序中,在执行部分curl转换的模式之后,buttom中的工具栏仍然可见。 当我使用局部curl在故事板中设置模态序列时,新的视图控制器将隐藏工具栏视图。

如何设置像Google地图应用程序一样的部分curl?

iPhone上的Google地图情节图板中的模态

你可能需要用OpenGL ES来做这个。 核心animation暴露了使用图层的能力,即使在3D中 ,但是所有图层都只是矩形,而且它们也是这样操纵的。 即使透视失真 ,您也可以对一个图层的翻转animation,但是您想要做的曲线比使用Core Animation API进行pipe理要复杂得多。

您可以将图像分割成小图层网格,然后使用CATransform3D对每个图层进行操作以创build这种弯曲效果,但此时您可能会使用OpenGL ES创build相同的效果。

试试这个代码。这会对你有所帮助。 请不要犹豫,试试这个代码

你将需要导入一个QuartzCore.framework。

locationMapView是你的MKMapViewcurlView是你的第二个UIView

 - (IBAction)curlButtonPressed:(id)sender { if (isCurlStarted == NO) { [UIView animateWithDuration:1.0 animations:^{ CATransition *animation = [CATransition animation]; [animation setDelegate:self]; [animation setDuration:0.7]; [animation setTimingFunction:[CAMediaTimingFunction functionWithName:@"default"]]; animation.type = @"pageCurl"; animation.fillMode = kCAFillModeForwards; animation.endProgress = 0.65; [animation setRemovedOnCompletion:NO]; [locationMapView.layer addAnimation:animation forKey:@"pageCurlAnimation"]; [locationMapView addSubview:curlView]; ;} ]; isCurlStarted = YES; }else{ [self curlDownPressed:curlDownButton]; } } - (IBAction)curlDownPressed:(id)sender { [UIView animateWithDuration:1.0 animations:^{ CATransition *animation = [CATransition animation]; [animation setDelegate:self]; [animation setDuration:0.7]; [animation setTimingFunction:[CAMediaTimingFunction functionWithName:@"default"]]; animation.type = @"pageUnCurl"; animation.fillMode = kCAFillModeForwards; animation.startProgress = 0.35; [animation setRemovedOnCompletion:NO]; [locationMapView.layer addAnimation:animation forKey:@"pageUnCurlAnimation"]; [curlView removeFromSuperview]; ;} ]; isCurlStarted = NO; }