设为首页 加入收藏

TOP

应用程序下载(二)
2017-10-13 10:32:56 】 浏览:2154
Tags:应用 程序下载
geView *iconImage;

@property (weak, nonatomic) IBOutlet UILabel *nameLabel;

 

- (IBAction)btnClick:(UIButton *)sender;

 

 

@end

@implementation CZAppView

 

- (void)setApp:(CZApp *)app

{

    self.iconImage.image = [UIImage imageNamed:app.icon];

    self.nameLabel.text = app.name;

}

 

- (IBAction)btnClick:(UIButton *)sender

{

    //1.让按钮禁用

    sender.enabled = NO;

    

    //2.让屏幕中间显示一个文字

    UILabel *label = [[UILabel alloc]init];

    //设置属性

    label.bounds = CGRectMake(0, 0, 100, 30);

    label.center = self.superview.center;

    

    //设置背景颜色

    label.backgroundColor = [UIColor blackColor];

    

    //设置文字

    label.text = @"正在下载...";

    label.textColor = [UIColor whiteColor];

    label.font = [UIFont systemFontOfSize:13];

    

    label.textAlignment = NSTextAlignmentCenter;

    

    label.alpha = 0;

    

    

    //添加到对应控件中

    [self.superview addSubview:label];

    

    //添加动画效果

    

    

    [UIView animateWithDuration:2 animations:^{

        label.alpha = 1;

    } completion:^(BOOL finished) {

        if(finished)

        {

//            [UIView animateWithDuration:2 animations:^{

//                label.alpha = 0;

//            } completion:^(BOOL finished) {

//                if(finished)

//                {

//                    [label removeFromSuperview];

//                }

//            }];

            [UIView animateWithDuration:2.0 delay:2.0 options:UIViewAnimationOptionCurveLinear animations:^{

                label.alpha = 0;

            } completion:^(BOOL finished) {

                [label removeFromSuperview];

            }];

        }

    }];

    

    

    

}

@end

 

首页 上一页 1 2 下一页 尾页 2/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇网络安全——Base64编码、MD5、SH.. 下一篇Swift 可选值

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目