简体   繁体   English

制作动画效果,就像Skype iOS应用程序的菜单一样

[英]make animations effects just like skype iOS application's menu

I was trying to create animation like skype bottom menu in iPhone. 我试图在iPhone中创建像Skype底部菜单这样的动画。 I tried many ways to solve it but wasn't able to configure the accurate solution. 我尝试了多种方法来解决它,但无法配置准确的解决方案。 I have tried, 我努力了,

(1)CGPathAddLineToPoint
(2)CGPathAddArc
(3)CGPathAddArcToPoint
(4)[UIView animateWithDuration:5000 delay:500 usingSpringWithDamping:0.5 initialSpringVelocity:0.5 options:option animations:^{
        square.layer.cornerRadius = 25;
        square.layer.masksToBounds = YES;
    } completion:^(BOOL flag){
        square.layer.cornerRadius = 0;
        square.layer.masksToBounds = YES;
    }];

and some UIKit Dynamic approaches too. 还有一些UIKit Dynamic方法。 Unfortunately none of them worked for me to get exact solution. 不幸的是,他们都没有为我工作以获得确切的解决方案。 Main problem that i was facing was that CornerRadius rounds whole view, where i need something Curved/Arc. 我面临的主要问题是CornerRadius可以对整个视图进行倒圆角处理,而我需要一些“弯曲/弧形”的东西。 Ark approach also didn't provides needed solution. 方舟方法也未提供所需的解决方案。

Animation in Skype works this way. Skype中的动画以这种方式工作。

Working Demo 工作演示

(1)Firstly user taps on bottom right, (1)首先,用户点击右下角,

在此处输入图片说明

(2)Then menu animates upward with a curved (curved outside) effect, (2)然后,菜单通过弯曲(外部弯曲)效果向上动画,

在此处输入图片说明

(3) After collision with top boundary (i guess it is using UIKit Dynamic and on top there is an invisible boundary), Menu shows a bounce back effect and again shows a curved effect but this time curve inside, (3)与顶部边界发生碰撞后(我猜它正在使用UIKit Dynamic,并且顶部存在不可见的边界),Menu显示了反弹效果,再次显示了弯曲效果,但是此时间曲线在内部,

在此处输入图片说明

Kindly guide if i'm using right approach or what should i do? 请指导我是否使用正确的方法或应该怎么做? Thanks 谢谢

this is a nicely written tutorial on how to create such animation: http://holko.pl/2014/06/26/recreating-skypes-action-sheet-animation/ 这是一篇有关如何制作这种动画的精美教程: http : //holko.pl/2014/06/26/recreating-skypes-action-sheet-animation/

At the end of the tutorial, the author also includes the github address that hosts a reusable framework that you can directly use to create such effect. 在本教程的最后,作者还提供了托管可重用框架的github地址,您可以直接使用该框架来创建这种效果。

Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM