欢迎光临
我们一直在努力

SMButtonDropAnimation 菜单

建站超值云服务器,限时71元/月

SMButtonDropAnimation 菜单

项目介绍:

[分享] 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 直接下载:

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » SMButtonDropAnimation 菜单
分享到: 更多 (0)