////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