我想应用带有动画的视图过渡

发布于 2025-01-02 14:01:03 字数 611 浏览 1 评论 0原文

- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
 {
CGFloat xpos = responseView.frame.origin.x;
    CGFloat ypos = responseView.frame.origin.y; 
[UIView transitionWithView:responseView duration:1      options:UIModalTransitionStyleCrossDissolve animations:^{ responseView.frame = CGRectMake(xpos,ypos,720,700);
    [responseView.superview bringSubviewToFront:responseView];
    [responseView.superview addSubview:responseView];
}
                completion: ^(BOOL finished)  {NSLog(@"DONE");}];   
  }

我想应用带有动画的视图转换。我尝试了下面的代码。代码工作正常,现在我需要以有吸引力的方式更改动画的类型。请给我一个建议

- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
 {
CGFloat xpos = responseView.frame.origin.x;
    CGFloat ypos = responseView.frame.origin.y; 
[UIView transitionWithView:responseView duration:1      options:UIModalTransitionStyleCrossDissolve animations:^{ responseView.frame = CGRectMake(xpos,ypos,720,700);
    [responseView.superview bringSubviewToFront:responseView];
    [responseView.superview addSubview:responseView];
}
                completion: ^(BOOL finished)  {NSLog(@"DONE");}];   
  }

I want to apply a view transition with animation.I tried the code below.The code is working fine ,Now I need to change the type of the animation in a attractive manner.Please give me a suggestion

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

浅浅 2025-01-09 14:01:03

UIModalTransitionStyleCrossDissolve 不是一个有效的动画选项(尽管它可能仍然有效,因为枚举毕竟只是整数)。

对于过渡样式,您有以下选择:

UIViewAnimationOptionTransitionFlipFromLeft
UIViewAnimationOptionTransitionFlipFromRight
UIViewAnimationOptionTransitionCurlUp
UIViewAnimationOptionTransitionCurlDown
UIViewAnimationOptionTransitionCrossDissolve
UIViewAnimationOptionTransitionFlipFromTop
UIViewAnimationOptionTransitionFlipFromBottom

您必须自己决定哪种看起来最好。

UIModalTransitionStyleCrossDissolve is not a valid animation option (though it may still work because enums are just integers after all).

For the transition style, you have the following options:

UIViewAnimationOptionTransitionFlipFromLeft
UIViewAnimationOptionTransitionFlipFromRight
UIViewAnimationOptionTransitionCurlUp
UIViewAnimationOptionTransitionCurlDown
UIViewAnimationOptionTransitionCrossDissolve
UIViewAnimationOptionTransitionFlipFromTop
UIViewAnimationOptionTransitionFlipFromBottom

You'll have to decide for yourself which looks best.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文