当前位置: 首页 > news >正文

手机网站如何做计算机网站开发和软件开发

手机网站如何做,计算机网站开发和软件开发,app推广视频,设计在线官网作品欣赏本文讲述了IOS实现签到特效(散花效果)实例代码。分享给大家供大家参考#xff0c;具体如下#xff1a;散花特效#import /// 领取奖励成功interface RewardSuccess : NSObject/*** 成功动画*/ (void)show;end#import RewardSuccess.h#import RewardSuccessW…本文讲述了IOS实现签到特效(散花效果)实例代码。分享给大家供大家参考具体如下散花特效#import /// 领取奖励成功interface RewardSuccess : NSObject/*** 成功动画*/ (void)show;end#import RewardSuccess.h#import RewardSuccessWindow.h#define EmitterColor_Red [UIColor colorWithRed:255/255.0 green:0 blue:139/255.0 alpha:1]#define EmitterColor_Yellow [UIColor colorWithRed:251/255.0 green:197/255.0 blue:13/255.0 alpha:1]#define EmitterColor_Blue [UIColor colorWithRed:50/255.0 green:170/255.0 blue:207/255.0 alpha:1]implementation RewardSuccess (void)show{UIWindow *window [UIApplication sharedApplication].keyWindow;UIView *backgroundView [[UIView alloc] initWithFrame:window.bounds];backgroundView.backgroundColor [UIColor colorWithRed:0 green:0 blue:0 alpha:0.8];[window addSubview:backgroundView];RewardSuccessWindow *successWindow [[RewardSuccessWindow alloc] initWithFrame:CGRectZero];[backgroundView addSubview:successWindow];//缩放successWindow.transformCGAffineTransformMakeScale(0.01f, 0.01f);successWindow.alpha 0;[UIView animateWithDuration:0.4 animations:^{successWindow.transform CGAffineTransformMakeScale(1.0f, 1.0f);successWindow.alpha 1;}];//3s 消失double delayInSeconds 3;dispatch_time_t delayInNanoSeconds dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC);dispatch_after(delayInNanoSeconds, dispatch_get_main_queue(), ^(void){[UIView animateWithDuration:0.4 animations:^{successWindow.transform CGAffineTransformMakeScale(.3f, .3f);successWindow.alpha 0;}completion:^(BOOL finished) {[backgroundView removeFromSuperview];}];});//开始粒子效果CAEmitterLayer *emitterLayer addEmitterLayer(backgroundView,successWindow);startAnimate(emitterLayer);}CAEmitterLayer *addEmitterLayer(UIView *view,UIView *window){//色块粒子CAEmitterCell *subCell1 subCell(imageWithColor(EmitterColor_Red));subCell1.name red;CAEmitterCell *subCell2 subCell(imageWithColor(EmitterColor_Yellow));subCell2.name yellow;CAEmitterCell *subCell3 subCell(imageWithColor(EmitterColor_Blue));subCell3.name blue;CAEmitterCell *subCell4 subCell([UIImage imageNamed:success_star]);subCell4.name star;CAEmitterLayer *emitterLayer [CAEmitterLayer layer];emitterLayer.emitterPosition window.center;emitterLayer.emitterPosition window.center;emitterLayer.emitterSize window.bounds.size;emitterLayer.emitterMode kCAEmitterLayerOutline;emitterLayer.emitterShape kCAEmitterLayerRectangle;emitterLayer.renderMode kCAEmitterLayerOldestFirst;emitterLayer.emitterCells [subCell1,subCell2,subCell3,subCell4];[view.layer addSublayer:emitterLayer];return emitterLayer;}void startAnimate(CAEmitterLayer *emitterLayer){CABasicAnimation *redBurst [CABasicAnimation animationWithKeyPath:emitterCells.red.birthRate];redBurst.fromValue [NSNumber numberWithFloat:30];redBurst.toValue [NSNumber numberWithFloat: 0.0];redBurst.duration 0.5;redBurst.timingFunction [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear];CABasicAnimation *yellowBurst [CABasicAnimation animationWithKeyPath:emitterCells.yellow.birthRate];yellowBurst.fromValue [NSNumber numberWithFloat:30];yellowBurst.toValue [NSNumber numberWithFloat: 0.0];yellowBurst.duration 0.5;yellowBurst.timingFunction [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear];CABasicAnimation *blueBurst [CABasicAnimation animationWithKeyPath:emitterCells.blue.birthRate];blueBurst.fromValue [NSNumber numberWithFloat:30];blueBurst.toValue [NSNumber numberWithFloat: 0.0];blueBurst.duration 0.5;blueBurst.timingFunction [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear];CABasicAnimation *starBurst [CABasicAnimation animationWithKeyPath:emitterCells.star.birthRate];starBurst.fromValue [NSNumber numberWithFloat:30];starBurst.toValue [NSNumber numberWithFloat: 0.0];starBurst.duration 0.5;starBurst.timingFunction [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear];CAAnimationGroup *group [CAAnimationGroup animation];group.animations [redBurst,yellowBurst,blueBurst,starBurst];[emitterLayer addAnimation:group forKey:heartsBurst];}CAEmitterCell *subCell(UIImage *image){CAEmitterCell * cell [CAEmitterCell emitterCell];cell.name heart;cell.contents (__bridge id _Nullable)image.CGImage;// 缩放比例cell.scale 0.6;cell.scaleRange 0.6;// 每秒产生的数量// cell.birthRate 40;cell.lifetime 20;// 每秒变透明的速度// snowCell.alphaSpeed -0.7;// snowCell.redSpeed 0.1;// 秒速cell.velocity 200;cell.velocityRange 200;cell.yAcceleration 9.8;cell.xAcceleration 0;//掉落的角度范围cell.emissionRange M_PI;cell.scaleSpeed -0.05; cell.alphaSpeed -0.3;cell.spin 2 * M_PI;cell.spinRange 2 * M_PI;return cell;}UIImage *imageWithColor(UIColor *color){CGRect rect CGRectMake(0, 0, 13, 17);UIGraphicsBeginImageContext(rect.size);CGContextRef context UIGraphicsGetCurrentContext();CGContextSetFillColorWithColor(context, [color CGColor]);CGContextFillRect(context, rect);UIImage *image UIGraphicsGetImageFromCurrentImageContext();UIGraphicsEndImageContext();return image;}end领取奖励成功提示框#import /// 领取奖励成功提示框interface RewardSuccessWindow : UIViewend#import RewardSuccessWindow.hstatic CGFloat SuccessWindow_width 270;static CGFloat SuccessWindow_hight 170;implementation RewardSuccessWindow(instancetype)initWithFrame:(CGRect)frame{CGSize screenSize [UIScreen mainScreen].bounds.size;self [super initWithFrame:CGRectMake((screenSize.width - SuccessWindow_width)/2.0 , (screenSize.height - SuccessWindow_hight)/2.0, SuccessWindow_width, SuccessWindow_hight)];if (self){[self configSubViews];}return self;}- (void)configSubViews{self.backgroundColor [UIColor whiteColor];self.layer.cornerRadius 10;self.layer.masksToBounds YES;UILabel *titleLabel [[UILabel alloc] initWithFrame:CGRectMake(0, 45, SuccessWindow_width, 22)];titleLabel.text 恭喜您领取成功;titleLabel.font [UIFont systemFontOfSize:19.0];titleLabel.textAlignment NSTextAlignmentCenter;[self addSubview:titleLabel];UILabel *expLabel [[UILabel alloc] initWithFrame:CGRectMake(0, 75, SuccessWindow_width, 43)];expLabel.font [UIFont systemFontOfSize:15];expLabel.textAlignment NSTextAlignmentCenter;[self addSubview:expLabel];NSString *string 获得经验6;NSMutableAttributedString *attributedString [[NSMutableAttributedString alloc] initWithString:string];[attributedString addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:15] range:NSMakeRange(0, string.length)];[attributedString addAttribute:NSFontAttributeName value:[UIFont fontWithName:MarkerFelt-Thin size:35] range:NSMakeRange(5,2)];NSShadow *shadow [[NSShadow alloc] init];shadow.shadowOffset CGSizeMake(1, 3);[attributedString addAttribute:NSShadowAttributeName value:shadow range:NSMakeRange(5,2)];[attributedString addAttribute:NSForegroundColorAttributeName value:[UIColor yellowColor] range:NSMakeRange(5,2)];expLabel.attributedText attributedString;UILabel *bottomLabel [[UILabel alloc] initWithFrame:CGRectMake(0, 135, SuccessWindow_width, 22)];bottomLabel.text 可以在我的-我的奖励中查看获得奖励;bottomLabel.font [UIFont systemFontOfSize:13.0];bottomLabel.textAlignment NSTextAlignmentCenter;bottomLabel.textColor [UIColor colorWithRed:177/255.0 green:177/255.0 blue:177/255.0 alpha:1];[self addSubview:bottomLabel];}end
http://www.yutouwan.com/news/170148/

相关文章:

  • 驻马店网站开发基层网站建设作用
  • 网站注册域名类似朋友圈wordpress
  • 福建建设培训中心网站简历设计网
  • 网站第三方微信登陆怎么做的销售易app官网下载
  • 先做网站还是先备案京东网址
  • 太原模板建站优化图片传网站
  • 哪些人可以做网站国际俄罗斯乌克兰
  • vps怎么添加网站wordpress 高亮插件
  • 需要企业网站建设基于网站开发app
  • 建设网站一般要多久到账制作二维码
  • 网站首页模块建设保定网站制作设计哪个公司好
  • 前端网站开发课程购物商城网站源码
  • 盐城手机网站建设学习建网站玩网站建设学习
  • wordpress仿站容易被收录不设计网站页面出现问题
  • 家政公司网站的建设南京网络推广网站建设公司
  • 临淄网站制作首选专家余姚网站制作
  • 建站公司排名 软通成都购物网站设计
  • 做海报的免费网站牟平网站建设
  • 网站运营托管方案国内装修公司排名前十强
  • m版网站开发深建工程集团有限公司
  • 网站安全检测在线学校网站 源码
  • 推荐西安知名的集团门户网站建设公司国家企业信用查询系统官网
  • 网站运营需要哪些技术网站设计书籍
  • 北京app网站开发枣强做百度网站
  • 建设银行网站打不开别的网站可以吗十大免费跨境app
  • 佛山做网站-准度科技公司哪里可以做网站推广
  • 安卓和网站开发找工作snippets wordpress
  • 网站前端用的到ps美食电子商务网站建设策划书
  • 济南网站建设推荐q479185700强涵优质网站建设方案
  • 正规网站制作价格企业简介优势项目案例等推广