简体   繁体   中英

make animations effects just like skype iOS application's menu

I was trying to create animation like skype bottom menu in iPhone. 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. 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. Ark approach also didn't provides needed solution.

Animation in Skype works this way.

Working Demo

(1)Firstly user taps on bottom right,

在此处输入图片说明

(2)Then menu animates upward with a curved (curved outside) effect,

在此处输入图片说明

(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,

在此处输入图片说明

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/

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.

Hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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