
iOS 动画
文章平均质量分 87
番薯大佬
码农一枚
展开
-
简单的动画
[UIView beginAnimations:nil context:nil];[UIView setAnimationDuration:0.3];[UIView setAnimationRepeatCount:10];[UIView setAnimationDelay:1.0];// doing something... [UIView commitAnimations];[原创 2016-08-01 15:15:35 · 303 阅读 · 0 评论 -
具有动画变化效果的数字处理
实现效果代码实现1、定义类,继承UILabel#import <UIKit/UIKit.h>@interface AnimationLabel : UILabel@property (nonatomic, assign) NSTimeInterval duration;/** 动画数字改变 @param fromValue 开始数值 @param toVa...原创 2018-11-19 11:28:39 · 931 阅读 · 0 评论 -
视图控制器转场动画——CATransition
github:https://github.com/potato512/SYAnimation使用CATransition进行视图控制器的转场动画自定义。效果图:代码示例: // 转场动画 CATransition *animation = [CATransition animation]; animation.duration = 0原创 2017-06-07 17:00:44 · 1516 阅读 · 0 评论 -
CATransition动画的使用
CATransition动画主要是通过设置一些动画属性,然后将CATransition实例添加到UIView的layer层上以实现动画效果。/** * CATransition动画效果 * * @param type 动画效果类型kCATransitionFade,kCATransitionMoveIn,kCATransitionPush,kCATransit原创 2016-08-01 16:20:20 · 941 阅读 · 0 评论 -
动画的暂停与继续播放
在使用动画控制UI的时候,可能会碰到通过手势或其他方式要进行暂停正在进行中的动画,然后再继续。如手指按下时,暂停动画,手指离开时继续动画。实现原理主要是通过UI的layer进行相关的控制。暂停动画:- (void)pauselayer:(CALayer *)layer{ CFTimeInterval pausedTime = [layer convertTime:CACurren原创 2017-05-24 11:57:57 · 1784 阅读 · 0 评论 -
弹簧动画效果
github:https://github.com/potato512/SYAnimation使用CASpringAnimation实现弹簧动画效果。效果图:代码示例:- (void)springAnimation{ UIView *view = [[UIView alloc] initWithFrame:CGRectMake(120.0, 1原创 2017-02-08 17:15:33 · 1010 阅读 · 0 评论 -
水纹波浪效果动画
github:https://github.com/potato512/SYAnimation效果图:示例代码见"github:https://github.com/potato512/SYAnimation"中的"SYWaterAnimationView"类。使用:// 使用方法1SYWaterAnimationView *waterView = [原创 2017-02-08 16:29:58 · 3367 阅读 · 0 评论 -
椭圆线条绘制动画
github:https://github.com/potato512/SYAnimation使用贝赛尔曲线UIBezierPath、阴影对象CAShapeLayer、基础类动画CABasicAnimation实现。效果图如下:示例代码:- (void)lineAnimation{ UIView *view = [[UIView alloc]原创 2017-02-08 16:26:10 · 969 阅读 · 0 评论 -
火焰动画
github:https://github.com/potato512/SYAnimation使用发射对象CAEmitterLayer、发射单元CAEmitterCell对象创建火焰动画效果。效果图如下:代码示例:+ (void)animationFireWithImage:(NSString *)imageName view:(UIView *)view frame:(C原创 2017-02-08 16:22:43 · 512 阅读 · 0 评论 -
多种动画效果AnimationView
源码原创 2016-10-18 11:43:00 · 380 阅读 · 0 评论 -
CAKeyframeAnimation动画的使用
/** * CAKeyframeAnimation动画 * * @param view 添加动画效果的UIView * @param keyPath 动画类型 * @param values 动画效果Values方式 * @param refPath 动画效果path方式 * @param duration 动画时间,默认0.3 * @par原创 2016-08-01 17:41:29 · 895 阅读 · 0 评论 -
CAAnimationGroup动画的使用
// 使用示例CABasicAnimation *rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];rotationAnimation.toValue = [NSNumber numberWithFloat:(2 * M_PI) * 2];rotationAnimation.原创 2016-08-01 17:00:41 · 967 阅读 · 0 评论 -
CABasicAnimation动画的使用
CABasicAnimation实现的动画效果主要有移动、放大或缩小、旋转(以x轴,或y轴,或z轴为中心)。在实现过程中,主要通过设置终点值进行控制,同时动画效果是添加在UIview的layer层。/** * CABasicAnimation动画 * * @param view 添加动画效果的UIView对象 * @param path 动画类型 * @p原创 2016-08-01 16:55:21 · 476 阅读 · 0 评论 -
硬币翻转动画效果
效果图 示例UIImageView *firstImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"profile.png"]];UIImageView *secondImageView = [[UIImageView alloc] initWithImage:[UIIma原创 2016-08-01 16:04:04 · 2300 阅读 · 0 评论 -
各种效果动画操作展示(放大、缩小、旋转、翻转等)
各效果动画主要是对UIView,或UIView的layer进行操作。动画效果有放大、缩小、旋转、翻转等操作;以及还有私有API的方法,如立方体旋转、相机开或关、抽纸、涟漪等。1、各种动画效果 其中除了'fade', `moveIn', `push' , `reveal' ,其他属于似有的API(我是这么认为的,可以点进去看下注释).可以分别使用'kCATransitionFad原创 2016-08-01 15:57:16 · 5188 阅读 · 0 评论 -
心跳呼吸动画
示例UIView *scaleView = [[UIView alloc] initWithFrame:CGRectMake((self.view.frame.size.width - 100) / 2, 200, 100, 100)];scaleView.backgroundColor = UIColor.blueColor;scaleView.layer.cornerRadius = 5...原创 2019-07-12 14:00:07 · 406 阅读 · 0 评论