登录 立即注册
金钱:

Code4App-iOS开发-iOS 开源代码库-iOS代码实例搜索-iOS特效示例-iOS代码例子下载-Code4App.com

天气动画

[复制链接]
来自: Zws丶 分类: iOS精品源码 上传时间: 2017-5-15 11:14:01
Tag:天气 动画

项目介绍:

Weather

墨迹天气,天气预报,动态天气,天气Animation

GitHub: https://github.com/Zws-China/Weather

PhotoShoot

图片描述

图片描述

图片描述

这里写图片描述

How To Use



//动画横向移动方法(云、鸟移动)
- (CABasicAnimation *)birdFlyAnimationWithToValue:(NSNumber *)toValue duration:(NSInteger)duration{
    CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform.translation.x"];
    animation.toValue = toValue;
    animation.duration = duration;
    animation.removedOnCompletion = NO;
    animation.repeatCount = MAXFLOAT;
    animation.fillMode = kCAFillModeForwards;
    return animation;
}

//动画旋转方法,(阳光旋转、雪花旋转)
- (CABasicAnimation *)sunshineAnimationWithDuration:(NSInteger)duration{
    //旋转动画
    CABasicAnimation* rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
    rotationAnimation.toValue = [NSNumber numberWithFloat: M_PI * 2.0 ];
    [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
    rotationAnimation.duration = duration;
    rotationAnimation.repeatCount = MAXFLOAT;//你可以设置到最大的整数值
    rotationAnimation.cumulative = NO;
    rotationAnimation.removedOnCompletion = NO;
    rotationAnimation.fillMode = kCAFillModeForwards;
    return rotationAnimation;
}

//下雨、下雪动画方法
- (CABasicAnimation *)rainAnimationWithDuration:(NSInteger)duration{

    CABasicAnimation* caBaseTransform = [CABasicAnimation animation];
    caBaseTransform.duration = duration;
    caBaseTransform.keyPath = @"transform";
    caBaseTransform.repeatCount = MAXFLOAT;
    caBaseTransform.removedOnCompletion = NO;
    caBaseTransform.fillMode = kCAFillModeForwards;
    caBaseTransform.fromValue = [NSValue valueWithCATransform3D:CATransform3DMakeTranslation(-170, -620, 0)];
    caBaseTransform.toValue = [NSValue valueWithCATransform3D:CATransform3DMakeTranslation(kScreenHeight/2.0*34/124.0, kScreenHeight/2, 0)];

    return caBaseTransform;

}
//透明度动画
- (CABasicAnimation *)rainAlphaWithDuration:(NSInteger)duration {

    CABasicAnimation *showViewAnn = [CABasicAnimation animationWithKeyPath:@"opacity"];
    showViewAnn.fromValue = [NSNumber numberWithFloat:1.0];
    showViewAnn.toValue = [NSNumber numberWithFloat:0.1];
    showViewAnn.duration = duration;
    showViewAnn.repeatCount = MAXFLOAT;
    showViewAnn.fillMode = kCAFillModeForwards;
    showViewAnn.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
    showViewAnn.removedOnCompletion = NO;

    return showViewAnn;
}

相关源码推荐:

我来说两句
*滑动验证:
所有评论(15)
phoiu 2017-5-15 11:14:12
感谢分享,楼主V5~
回复
BlueManlove 2017-5-15 11:14:25
虽不明,但觉厉...
回复
AlonMessi 2017-5-15 11:14:35
好好 学习了 确实不错
回复
kengsir 2017-5-15 11:14:36
感谢分享,楼主V5~
回复
hellokenken 2017-5-15 11:14:48
膜拜大神~
回复
littleRed 2017-5-15 11:15:29
好好 学习了 确实不错
回复
manmanyun 2017-5-16 13:07:28
好厉害的样子,啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊
回复
manmanyun 2017-5-16 13:11:34
阿萨德发生的发生的发
回复
manmanyun 2017-5-16 13:14:40
回帖惺惺惜惺惺想寻寻寻寻寻寻寻寻寻寻寻寻寻
回复
12下一页
772 1 0
联系我们
首页/微信公众账号投稿

帖子代码编辑/版权问题

QQ:435399051,742864542

如何获得代码达人称号?

代码贡献英雄榜
用户名 下载数
通过邮件订阅最新 Code4App 信息
上一条 /4 下一条
联系我们
关闭
合作电话:
13802416937
Email:
435399051@qq.com
商务市场合作/投稿
问题反馈及帮助
联系我们

广告投放| Github|申请友链|手机版|Code4App ( 粤ICP备15117877号-1 )

快速回复 返回顶部 返回列表