ios-App Management click button to download animation

Source: Internet
Author: User

////czappview.m//Application Management////Created by Yaguangzhu on 15/8/1.//Copyright (c) 2015 Yaguangzhu. All rights reserved.//#import "CZAppView.h"#import "App.h"@interfaceCzappview () @property (weak, nonatomic) Iboutlet Uiimageview*Imgviewicon, @property (weak, nonatomic) Iboutlet UILabel*Lblname, @property (weak, nonatomic) Iboutlet UIButton*Btndownload;-(Ibaction) Btndownloadclick: (UIButton *) sender;@end@implementationCzappview/*//Only override drawrect:if your perform custom drawing.//an empty implementation adversely affects performance Duri ng animation.-(void) DrawRect: (cgrect) Rect {//Drawing code}*/+(instancetype) appview{NSBundle*rootboundle =[NSBundle Mainbundle]; return[[Rootboundle loadnibnamed:@"Czappview"Owner:nil Options:nil] lastobject];}- (void) Setmodel: (APP *) model{_model=model; Self.imgViewIcon.image=[UIImage ImageNamed:model.icon]; Self.lblName.text=Model.miaoshu;}-(Ibaction) Btndownloadclick: (UIButton *) Sender {sender.enabled=NO; UILabel*lbmsg =[[UILabel alloc]init]; Lbmsg.text=@"downloading ....."; Lbmsg.backgroundcolor=[Uicolor Redcolor]; CGFloat VIEWW=Self.superview.frame.size.width; CGFloat VIEWH=Self.superview.frame.size.height; CGFloat MSGW= $; CGFloat MSGH= -; CGFloat MSGX= (VIEWW-MSGW)/2; CGFloat msgy= (VIEWH-MSGH) *0.5; Lbmsg.frame=CGRectMake (MSGX, Msgy, MSGW, MSGH); //ColorLbmsg.textcolor =[Uicolor Blackcolor]; //CenterLbmsg.textalignment =Nstextalignmentcenter; //Bold BodyLbmsg.font = [Uifont boldsystemfontofsize: -]; //TransparencyLbmsg.alpha =0.0; //Set rounded cornersLbMsg.layer.cornerRadius =Ten; LbMsg.layer.masksToBounds=YES;//[UIView animatewithduration:1.0 animations:^{//Lbmsg.alpha = 0.5;//    }]; //turn on another animation at the end of an animation delay 1 seconds start[UIView animatewithduration:1.5animations:^{Lbmsg.alpha=0.5; } Completion:^(BOOL finished) {if(finished) {[UIView animatewithduration:1.5Delay1.0Options:uiviewanimationoptioncurvelinear animations:^{Lbmsg.alpha=0; } Completion:^(BOOL finished) {if(finished) {[lbmsg Removefromsuperview];        }            }];        }    }];    [Self.superview addsubview:lbmsg]; }@end

ios-App Management click button to download animation

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.