gpt4 book ai didi

objective-c - 如何设置不隐藏工具栏的部分 curl 模态?

转载 作者:塔克拉玛干 更新时间:2023-11-02 09:32:43 25 4
gpt4 key购买 nike

在 iPhone 上的 Google map 应用程序中,在预形成具有部分 curl 过渡的模态之后,按钮中的工具栏仍然可见。当我在 Storyboard中使用部分 curl 设置模态序列时,新的 View Controller 将工具栏从父 View 中隐藏起来。

如何像 Google map 应用一样设置部分 curl ?

Google Maps on iPhone Modal in Storyboard

最佳答案

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

您需要导入一个 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;
}

关于objective-c - 如何设置不隐藏工具栏的部分 curl 模态?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9939439/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com