项目介绍:
[分享] SMButtonDropAnimation
一个时间轴展开菜单,点击之后会出现时间轴菜单选项,类似代码可以参考:http://code4app.com/forum.php?mo … teline%26sortid%3D1
展开菜单代码:
[Objective-C] 查看源文件 复制代码
-(void)expandMenue:(UIButton *)btn{ imgVw4manuePnlBckGrnd.hidden=NO; lbl4delivery.alpha=0; lbl4help.alpha=0; lbl4processsing.alpha=0; lbl4logout.alpha=0; [UIView animateWithDuration:.20 animations:^{ btn4delevry.alpha=1; _constant4DeliveryHstry.constant=gapingRatio/8; _constant4help.constant=gapingRatio/8; _constant4procsQue.constant=gapingRatio/8; _constant4sequenceQue.constant=gapingRatio/8; _constant4LogOut.constant=gapingRatio/8; _constant4imgVwTop.constant=gapingRatio/8; _constant4top_delivery.constant=gapingRatio/8+12; _constant4top_help.constant=gapingRatio/8+12; _constant4top_process.constant=gapingRatio/8+12; _constant4top_sequenceQueue.constant=gapingRatio/8+12; _constant4top_logout.constant=gapingRatio/8+12; [self.view updateConstraints]; [self.view layoutIfNeeded]; }completion:^(BOOL finished) { [self BounceInButton:btn4delevry]; [self deliveryOptionTextOpen]; [UIView animateWithDuration:.20 animations:^{ btn4help.alpha=1; _constant4help.constant= _constant4top_logout.constant+gapingRatio/8; _constant4procsQue.constant=_constant4top_logout.constant+gapingRatio/8; _constant4sequenceQue.constant=_constant4top_logout.constant+gapingRatio/8; _constant4LogOut.constant=_constant4top_logout.constant+gapingRatio/8; _constant4imgVwTop.constant=_constant4top_logout.constant+gapingRatio/8; _constant4top_help.constant=_constant4top_logout.constant+gapingRatio/8+12; _constant4top_process.constant=_constant4top_logout.constant+gapingRatio/8+12; _constant4top_sequenceQueue.constant=_constant4top_logout.constant+gapingRatio/8+12; _constant4top_logout.constant=_constant4top_logout.constant+gapingRatio/8+12; [self.view updateConstraints]; [self.view layoutIfNeeded]; }completion:^(BOOL finished) { [self BounceInButton:btn4help]; [self HelopOptionTextOpen]; [UIView animateWithDuration:.20 animations:^{ btn4Process.alpha=1; _constant4procsQue.constant=_constant4top_logout.constant+gapingRatio/8; _constant4sequenceQue.constant=_constant4top_logout.constant+gapingRatio/8; _constant4LogOut.constant=_constant4top_logout.constant+gapingRatio/8; _constant4imgVwTop.constant=_constant4top_logout.constant+gapingRatio/8; _constant4top_process.constant=_constant4top_logout.constant+gapingRatio/8+12; _constant4top_sequenceQueue.constant=_constant4top_logout.constant+gapingRatio/8+12; _constant4top_logout.constant=_constant4top_logout.constant+gapingRatio/8+12; [self.view updateConstraints]; [self.view layoutIfNeeded]; }completion:^(BOOL finished) { [self BounceInButton:btn4Process]; [self ProcessOptionTextopen]; [UIView animateWithDuration:.20 animations:^{ btn4sequenceQueue.alpha=1; _constant4sequenceQue.constant=_constant4top_sequenceQueue.constant+gapingRatio/8; _constant4LogOut.constant=_constant4top_logout.constant+gapingRatio/8; _constant4imgVwTop.constant=_constant4top_sequenceQueue.constant+gapingRatio/8; _constant4top_sequenceQueue.constant=_constant4top_sequenceQueue.constant+gapingRatio/8+12; _constant4top_logout.constant=_constant4top_logout.constant+gapingRatio/8+12; [self.view updateConstraints]; [self.view layoutIfNeeded]; }completion:^(BOOL finished) { [self BounceInButton:btn4sequenceQueue]; [self sequenceQueueOpen]; [UIView animateWithDuration:.20 animations:^{ btn4logOut.alpha=1; _constant4LogOut.constant=_constant4top_logout.constant+gapingRatio/8; _constant4imgVwTop.constant=_constant4top_logout.constant+gapingRatio/8; _constant4top_logout.constant=_constant4top_logout.constant+gapingRatio/8+12; [self.view updateConstraints]; [self.view layoutIfNeeded]; }completion:^(BOOL finished) { [self BounceInButton:btn4logOut]; [self logoutOptiontextopen]; [UIView animateWithDuration:.20 animations:^{ _constant4imgVwTop.constant=self.view.frame.size.height-24; [self.view updateConstraints] ; [self.view layoutIfNeeded]; }completion:^(BOOL finished) { btn.userInteractionEnabled=YES; }]; }]; }]; }]; }]; }]; btn.tag=999; }
DEMO 直接下载: