几个动画demo

一、点击扩散效果

  这个效果没什么难度,主要是加深对核心动画的理解和使用,但是还是有几个想说明的地方。先看一下效果,具体内容代码里有注释。

//
//  CircleButton.m
//  UITest
//
//  Created by 邓竹立 on 16/11/14.
//  Copyright ? 2016年 GiveMeFive. All rights reserved.
//

#import "CircleButton.h"
#import "UIColor_Hex_Extension.h"
@interface CircleButton ()<CAAnimationDelegate>

@property(nonatomic,weak)CALayer *animationLayer;

@end

@implementation CircleButton

-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {

        //即使做了UIControlEventTouchDown 事件,依旧可以响应UIControlEventTouchUpInside 无需担心
        [self addTarget:self action:@selector(tapDown) forControlEvents:UIControlEventTouchDown];

    }
    return self;
}

-(void)tapDown{

    [self.animationLayer removeFromSuperlayer];

    CALayer *layer = [CALayer layer];
    self.animationLayer = layer;
    layer.frame = self.bounds;
    layer.cornerRadius = MIN(self.bounds.size.width/2, self.bounds.size.height/2);
    layer.backgroundColor = [UIColor colorWithHex:0x2381e5].CGColor;
    layer.masksToBounds = YES;
    [self.layer addSublayer:layer];

    //添加核心动画 (pop 其实也很好用)
    CABasicAnimation *transformAnimation = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
    transformAnimation.fromValue = @1;
    transformAnimation.toValue = @1.6;
    transformAnimation.duration = 0.5;

    //注意使用opacity,不要用alpha
    CAKeyframeAnimation *alphaAnimation = [CAKeyframeAnimation animationWithKeyPath:@"opacity"];
    alphaAnimation.values = @[@0,@.5,@0];
    alphaAnimation.duration = 0.5;
    alphaAnimation.removedOnCompletion = NO;

    CAAnimationGroup *groupAnimation = [CAAnimationGroup animation];
    groupAnimation.animations = @[alphaAnimation,transformAnimation];
    groupAnimation.duration = 0.5;
    groupAnimation.repeatCount = 1;

    //项目中我一般不会这么做,我会采用关闭隐式动画的方式解决动画回归的问题,这种方式是偷懒的方式,因为真实的layer 并没有在你看到的地方 , 你所看到的是 layer.presentationLayer
    groupAnimation.removedOnCompletion = NO;
    groupAnimation.fillMode = kCAFillModeForwards;
    groupAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];

    /**注意:**/
    //个人认为,下两行最危险。 因为addAnimation:会对groupAnimation做一次copy,如果你addAnimation后再对groupAnimation做任何修改是不起作用的
    groupAnimation.delegate = self;
    [layer addAnimation:groupAnimation forKey:@"circle"];

    self.userInteractionEnabled = NO;
    __weak typeof(self) weakSelf = self;
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        weakSelf.userInteractionEnabled = YES;
    });
}

-(void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag{
    [self.animationLayer removeFromSuperlayer];

}

@end

二、图片轮播

  图片轮播已经老生常谈了,我在一个APP上看到这个效果还不错就试着写了下。代码没什么,主要是逻辑上的处理。

//
//  AnimationCycleScrollView.m
//  UITest
//
//  Created by 邓竹立 on 16/11/14.
//  Copyright ? 2016年 GiveMeFive. All rights reserved.
//

#import "AnimationCycleScrollView.h"
#import "UIColor_Hex_Extension.h"

@interface AnimationCycleScrollView ()<UIScrollViewDelegate,UIGestureRecognizerDelegate>

@property(nonatomic,weak)UIScrollView *backScrollView;

@property(nonatomic,weak)UIScrollView *frontScrollView;

@property(nonatomic,weak)UIView *panView;

@property(nonatomic,weak)UIPageControl *pageControl;

@property(nonatomic,assign)CGPoint startPoint;

@property(nonatomic,strong)NSArray *images;

@property(nonatomic,strong)NSArray* titleViews;

@end

@implementation AnimationCycleScrollView

-(instancetype)initWithFrame:(CGRect)frame images:(NSArray *)images titleViews:(NSArray *)titleViews{

    if (self = [super initWithFrame:frame]) {

        self.titleViews = titleViews;
        self.images = images;

        // 底层显示图片的scrollView
        UIScrollView *backScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, frame.size.width, frame.size.height)];
        [self addSubview:backScrollView];
        self.backScrollView = backScrollView;
        backScrollView.pagingEnabled = YES;
        backScrollView.contentSize = CGSizeMake((images.count+2)*frame.size.width, 0);
        backScrollView.showsVerticalScrollIndicator = NO;
        backScrollView.showsHorizontalScrollIndicator = NO;
        backScrollView.delegate = self;

        //顶层显示文字的scrollView
        UIScrollView *frontScrollView = [[UIScrollView alloc] init];
        frontScrollView.frame = backScrollView.frame;
        frontScrollView.delegate = self;
        frontScrollView.pagingEnabled = YES;
        frontScrollView.contentSize = CGSizeMake((titleViews.count+2)*frame.size.width, 0);
        frontScrollView.showsHorizontalScrollIndicator = NO;
        frontScrollView.showsVerticalScrollIndicator = NO;
        [self addSubview:frontScrollView];
        self.frontScrollView = frontScrollView;

        //手势view
        UIView *panView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, frame.size.width, frame.size.height)];
        panView.backgroundColor = [UIColor clearColor];
        [self addSubview:panView];
        UIPanGestureRecognizer *pan = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(pan:)];
        [panView addGestureRecognizer:pan];
        self.panView = panView;

        UIPageControl *pageControl = [[UIPageControl alloc] initWithFrame:CGRectMake(0, frame.size.height - 30, frame.size.width, 20)];
        self.pageControl = pageControl;
        pageControl.numberOfPages = images.count;
        pageControl.pageIndicatorTintColor = [UIColor whiteColor];
        pageControl.currentPageIndicatorTintColor = [UIColor colorWithHex:0x2381e5];
        pageControl.hidesForSinglePage = YES;
        pageControl.userInteractionEnabled = NO;
        [self addSubview:pageControl];

        for (int i = 0; i<images.count; i++) {

            UIImage *image = images[i];
            UIImageView *imageView = [[UIImageView alloc] init];
            imageView.image = image;
            imageView.frame = CGRectMake((i+1)*backScrollView.frame.size.width, 0, backScrollView.frame.size.width, backScrollView.frame.size.height);
            [backScrollView addSubview:imageView];
        }

        UIImageView *imageView = [[UIImageView alloc] init];
        imageView.image = [images lastObject];
        imageView.frame = CGRectMake(0, 0, backScrollView.frame.size.width, backScrollView.frame.size.height);
        [backScrollView addSubview:imageView];

        imageView = [[UIImageView alloc] init];
        imageView.image = [images firstObject];
        imageView.frame = CGRectMake(backScrollView.frame.size.width*(images.count+1), 0, backScrollView.frame.size.width, backScrollView.frame.size.height);
        [backScrollView addSubview:imageView];

        for (int i = 0; i<titleViews.count; i++) {

            UIView *view = titleViews[i];
            [frontScrollView addSubview:view];
            view.frame = CGRectMake((i+1)*frontScrollView.frame.size.width, 0, frontScrollView.frame.size.width, frontScrollView.frame.size.height);

        }
        UIView *view = [titleViews lastObject];
        NSData *data = [NSKeyedArchiver archivedDataWithRootObject:view];
        view = [NSKeyedUnarchiver unarchiveObjectWithData:data];
        view.frame = CGRectMake(0, 0, frontScrollView.frame.size.width, frontScrollView.frame.size.height);
        [frontScrollView addSubview:view];

        view = [titleViews firstObject] ;
        data = [NSKeyedArchiver archivedDataWithRootObject:view];
        view = [NSKeyedUnarchiver unarchiveObjectWithData:data];
        view.frame = CGRectMake((titleViews.count+1)*frontScrollView.frame.size.width, 0, frontScrollView.frame.size.width, frontScrollView.frame.size.height);
        [frontScrollView addSubview:view];

        frontScrollView.userInteractionEnabled = NO;
        backScrollView.userInteractionEnabled = NO;

        frontScrollView.contentOffset = CGPointMake(frontScrollView.frame.size.width, 0);
        backScrollView.contentOffset = CGPointMake(backScrollView.frame.size.width, 0);

    }
    return self;
}

-(void)pan:(UIPanGestureRecognizer*)ges{

    switch (ges.state) {
        case UIGestureRecognizerStateBegan:{
            self.startPoint = [ges locationInView:ges.view];

        }
            break;
        case UIGestureRecognizerStateEnded:{
            CGPoint endPoint = [ges locationInView:ges.view];
            [self dealWithEndPoint:endPoint];
        }
            break;

        case UIGestureRecognizerStateFailed:{
            CGPoint endPoint = [ges locationInView:ges.view];
            [self dealWithEndPoint:endPoint];

        }
            break;

        case UIGestureRecognizerStateCancelled:{
            CGPoint endPoint = [ges locationInView:ges.view];
            [self dealWithEndPoint:endPoint];
        }
            break;

        default:
            break;
    }
}

-(void)dealWithEndPoint:(CGPoint)endPoint{

    __weak typeof(self) weakSelf = self;
    if (endPoint.x < self.startPoint.x) {
        //不是最后一个
        if (self.frontScrollView.contentOffset.x <= self.frontScrollView.frame.size.width*(_titleViews.count - 1)) {

            [UIView animateKeyframesWithDuration:0.7 delay:0 options:UIViewKeyframeAnimationOptionCalculationModeCubicPaced animations:^{

                weakSelf.frontScrollView.contentOffset = CGPointMake(weakSelf.frontScrollView.contentOffset.x + weakSelf.frontScrollView.frame.size.width, 0);

            } completion:^(BOOL finished) {
                weakSelf.pageControl.currentPage = self.frontScrollView.contentOffset.x/self.frontScrollView.frame.size.width -1;
            }];

            [UIView animateKeyframesWithDuration:0.3 delay:0.2 options:UIViewKeyframeAnimationOptionCalculationModeDiscrete animations:^{

                weakSelf.backScrollView.contentOffset = CGPointMake(weakSelf.backScrollView.contentOffset.x + weakSelf.backScrollView.frame.size.width, 0);

            } completion:nil];

        }else{

            [UIView animateKeyframesWithDuration:0.7 delay:0 options:UIViewKeyframeAnimationOptionCalculationModeCubicPaced animations:^{

                weakSelf.frontScrollView.contentOffset = CGPointMake((weakSelf.titleViews.count+1)*weakSelf.frontScrollView.frame.size.width, 0);

            } completion:^(BOOL finished) {
                weakSelf.frontScrollView.contentOffset = CGPointMake(weakSelf.frontScrollView.frame.size.width, 0);
                weakSelf.pageControl.currentPage = 0 ;

            }];
            [UIView animateKeyframesWithDuration:0.3 delay:0.2 options:UIViewKeyframeAnimationOptionCalculationModeDiscrete animations:^{

                weakSelf.backScrollView.contentOffset = CGPointMake(weakSelf.backScrollView.frame.size.width*(_titleViews.count+1), 0);

            } completion:^(BOOL finished) {
                weakSelf.backScrollView.contentOffset = CGPointMake(weakSelf.backScrollView.frame.size.width, 0);
            }];
        }

    }else if (endPoint.x > self.startPoint.x){

        if (self.frontScrollView.contentOffset.x > self.frontScrollView.frame.size.width) {

            [UIView animateKeyframesWithDuration:0.7 delay:0 options:UIViewKeyframeAnimationOptionCalculationModeCubicPaced animations:^{

                weakSelf.frontScrollView.contentOffset = CGPointMake(weakSelf.frontScrollView.contentOffset.x - weakSelf.frontScrollView.frame.size.width, 0);

            }completion:^(BOOL finished) {
                weakSelf.pageControl.currentPage = weakSelf.frontScrollView.contentOffset.x/weakSelf.frontScrollView.frame.size.width -1 ;

            }];

            [UIView animateKeyframesWithDuration:0.3 delay:0.2 options:UIViewKeyframeAnimationOptionCalculationModeDiscrete animations:^{

                weakSelf.backScrollView.contentOffset = CGPointMake(weakSelf.backScrollView.contentOffset.x - weakSelf.backScrollView.frame.size.width, 0);

            }completion:nil];
        }else{

            [UIView animateKeyframesWithDuration:0.7 delay:0 options:UIViewKeyframeAnimationOptionCalculationModeCubicPaced animations:^{

                weakSelf.frontScrollView.contentOffset = CGPointMake(0, 0);

            }completion:^(BOOL finished) {
                weakSelf.frontScrollView.contentOffset = CGPointMake(weakSelf.frontScrollView.frame.size.width*(_titleViews.count), 0);
                weakSelf.pageControl.currentPage = _titleViews.count - 1;
            }];

            [UIView animateKeyframesWithDuration:0.3 delay:0.2 options:UIViewKeyframeAnimationOptionCalculationModeDiscrete animations:^{

                weakSelf.backScrollView.contentOffset = CGPointMake(0, 0);

            }completion:^(BOOL finished) {
                weakSelf.backScrollView.contentOffset = CGPointMake(weakSelf.backScrollView.frame.size.width*(_images.count), 0);
            }];
        }
    }
}

@end

三、毛毛虫效果

这个也是在那个APP上看到的,不得不佩服国外的APP 交互就是比较新颖。国内的APP交互效果基本都千篇一律。

//
//  SectionSelectView.m
//  UITest
//
//  Created by 邓竹立 on 16/11/14.
//  Copyright ? 2016年 GiveMeFive. All rights reserved.
//

#import "SectionSelectView.h"
#import "UIColor_Hex_Extension.h"

@interface SectionSelectView ()

@property(nonatomic,assign)NSInteger currentIndex;

@property(nonatomic,weak)UIView *backView;

@end

@implementation SectionSelectView

-(instancetype)initWithFrame:(CGRect)frame titles:(NSArray *)titles icons:(NSArray *)icons currentIndex:(NSInteger)index{

    if (self = [super initWithFrame:frame]) {

        self.currentIndex = index;

        CGFloat margin = 20;
        CGFloat w = (frame.size.width - (titles.count+1)*margin)/titles.count;
        CGFloat h = 40;

        UIView * backView = [[UIView alloc] init];
        backView.backgroundColor = [UIColor whiteColor];
        backView.layer.cornerRadius = 20;
        backView.clipsToBounds = YES;
        [self addSubview:backView];
        self.backView = backView;

        for (int i = 0; i<titles.count; i++) {

            NSString *title = titles[i];
            NSString *imageName = icons[i];
            UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
            [button setTitle:title forState:UIControlStateNormal];
            [self addSubview:button];
            button.frame = CGRectMake(margin+i*(margin+w), (frame.size.height - h)/2, w, h);
            [button setImage:[UIImage imageNamed:imageName] forState:UIControlStateNormal];
            button.titleLabel.font = [UIFont systemFontOfSize:14];
            [button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
            if (index == i) {
                backView.frame = button.frame;
                [button setTitleColor:[UIColor colorWithHex:0x2381e5] forState:UIControlStateNormal];
            }
            button.tag = 1000+i;
            [button addTarget:self action:@selector(didClickType:) forControlEvents:UIControlEventTouchUpInside];
        }
    }
    return self;
}

-(void)didClickType:(UIButton *)sender{

    if (sender.tag - 1000 == self.currentIndex) {
        return;
    }
    NSInteger index = sender.tag - 1000;
    UIButton *currentButton = [self viewWithTag:1000+self.currentIndex];
    __weak typeof(self) weakSelf = self;
    if (index > self.currentIndex) {
        [UIView animateWithDuration:0.5 animations:^{

            weakSelf.backView.frame = CGRectMake(currentButton.frame.origin.x, currentButton.frame.origin.y,sender.frame.origin.x+sender.frame.size.width - currentButton.frame.origin.x , sender.frame.size.height);

            [currentButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
            [sender setTitleColor:[UIColor colorWithHex:0x2381e5] forState:UIControlStateNormal];

        }completion:^(BOOL finished) {

            [UIView animateWithDuration:0.5 animations:^{
                weakSelf.backView.frame = sender.frame;
            }];
        }];

    }else{

        [UIView animateWithDuration:0.5 animations:^{
            weakSelf.backView.frame = CGRectMake(sender.frame.origin.x, sender.frame.origin.y, currentButton.frame.origin.x+currentButton.frame.size.width - sender.frame.origin.x, sender.frame.size.height);
            [currentButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
            [sender setTitleColor:[UIColor colorWithHex:0x2381e5] forState:UIControlStateNormal];
        }completion:^(BOOL finished) {
            [UIView animateWithDuration:0.5 animations:^{
                weakSelf.backView.frame = sender.frame;
            }];
        }];
    }

    self.currentIndex = sender.tag - 1000;
}

@end

四、任意view 的扩散效果

个人认为这个效果不好看,原APP 中这个使用这种扩散(或收缩)来介绍某个功能的按钮。

//
//  UIView+CircleAlert.m
//  UITest
//
//  Created by 邓竹立 on 16/11/15.
//  Copyright ? 2016年 GiveMeFive. All rights reserved.
//

#import "UIView+CircleAlert.h"
//#import <objc/runtime.h>

@implementation UIView (CircleAlert)

-(void)showCircleAlert{

    UIWindow *keyWindow = nil;
    for (UIWindow *window in  [UIApplication sharedApplication].windows) {

        if (window.rootViewController) {
            keyWindow = window;
            break;
        }
    }

    //截屏(我试过直接只用背景视图的Layer,但是对button 这类的View 不可用,打印发现,button.titleLabel 看不到)
    /*

     (lldb) po sender.layer
     <CALayer:0x6080000326c0; position = CGPoint (35 65); bounds = CGRect (0 0; 50 50); delegate = <UIButton: 0x7fc4c3f0d580; frame = (10 40; 50 50); opaque = NO; layer = <CALayer: 0x6080000326c0>>; sublayers = (<_UILabelLayer: 0x60000008c1c0>); allowsGroupOpacity = YES; backgroundColor = <CGColor 0x6080000adf20> [<CGColorSpace 0x6080000328a0> (kCGColorSpaceICCBased; kCGColorSpaceModelRGB; sRGB IEC61966-2.1; extended range)] ( 1 0 0 1 )>

     NSData *data = [NSKeyedArchiver archivedDataWithRootObject:sender.layer];
     CALayer *layer = [NSKeyedUnarchiver unarchiveObjectWithData:data];

     (lldb) po layer
     <CALayer:0x60000022b600; position = CGPoint (35 65); bounds = CGRect (0 0; 50 50); sublayers = (<_UILabelLayer: 0x60000008a000>); allowsGroupOpacity = YES; backgroundColor = <CGColor 0x6000000af120> [<CGColorSpace 0x60800002a660> (kCGColorSpaceICCBased; kCGColorSpaceModelRGB; sRGB IEC61966-2.1)] ( 1 0 0 1 )>

     */

    UIImageView *imageView = [[UIImageView alloc] init];
    imageView.frame = keyWindow.bounds;
    imageView.image = [self shootScreenWithView:keyWindow];

    //在真实的view 上盖一个半透明黑色layer;
    CALayer *blackLayer = [CALayer layer];
    blackLayer.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.5].CGColor;
    blackLayer.frame = keyWindow.layer.bounds;
    [keyWindow.layer addSublayer:blackLayer];

    //把导出的盖在真实的View 上;
    [keyWindow addSubview:imageView];

    //生成一个path 为圆的图层 作为Layer 的mask
    CAShapeLayer *shapeLayer = [CAShapeLayer layer];
    UIBezierPath *path = [UIBezierPath bezierPathWithArcCenter:self.center radius:sqrt(pow(self.bounds.size.width, 2)+pow(self.bounds.size.height, 2))/2 startAngle:0 endAngle:2*M_PI clockwise:YES];
    shapeLayer.path = path.CGPath;
    imageView.layer.mask = shapeLayer;

    //圆图层做放大动画
    CGSize size = [UIScreen mainScreen].bounds.size;
    CGFloat maxR = sqrt(pow(size.width, 2)+pow(size.height, 2));

    //添加动画
    CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"path"];
    animation.fromValue = (__bridge id _Nullable)(path.CGPath);
    animation.toValue = (__bridge id _Nullable)([UIBezierPath bezierPathWithArcCenter:self.center radius:maxR startAngle:0 endAngle:2*M_PI clockwise:YES].CGPath);
    animation.duration = 1;
    animation.fillMode = kCAFillModeForwards;
    animation.removedOnCompletion = NO;
    [shapeLayer addAnimation:animation forKey:@"path"];

    //动画完成 移除layer 和 view
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{

        [imageView removeFromSuperview];
        [blackLayer removeFromSuperlayer];
    });
}

//截屏
-(UIImage *)shootScreenWithView:(UIView*)view{

    UIGraphicsBeginImageContextWithOptions(view.bounds.size, NO, 0.0);
    CGContextRef ctx=UIGraphicsGetCurrentContext();
    [view.layer renderInContext: ctx];
    UIImage *image=UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    return image;
}

@end

代码写的比较暴力粗糙,如果有什么错误纰漏之处请联系我,QQ:395565391

时间: 2024-10-12 08:59:16

几个动画demo的相关文章

Android Animation 动画Demo(Frame逐帧动画)

上一篇介绍了Animation动画其一:Tween补间动画. 这篇文章接下来介绍Animation另一种动画形式:Frame逐帧动画. Frame动画是一系列图片按照一定的顺序展示的过程,和放电影的机制很相似,我们称为逐帧动画.Frame动画可以被定义在XML文件中,也可以完全编码实现(后面会给出这两种实现方式的源代码Demo). 下面分别介绍: 一.定义在xml中实现: 实现效果图: 源代码: 布局文件:main.xml: <?xml version="1.0" encodin

HTML5 CSS3 诱人的实例: 3D立方体旋转动画DEMO

创意来自:http://www.html5tricks.com/demo/html5-3d-cube/index.html , 同学给我发的例子,感觉很不错,不过实在想不出来实际的用处,但是效果很炫~ 效果图: 知识点: 1.perspective ,transform 的复习 2.css3 backgroud实现格格背景,即面上的小格格 3. @-webkit-keyframes 实现动画 HTML: <body> <div class="stage"> &l

Android Animation 动画Demo

本文主要介绍Android中的Animation动画. Android提供了2中动画:Tween动画和Frame动画. 本文中主要讲解Tween动画,下篇文章中会讲到Frame动画. Tween动画: 通过对View的内容进行一系列的图形变换(包括平移,缩放,旋转,改变透明度)来实现动画的效果,动画效果的定义可以采用XML方式也可以采用编码来做Tween动画(文章最后会给出两种方式动画的源代码Demo). 动画的类型 Xml定义动画使用的配置节点 编码定义动画使用的类 渐变透明度动画效果(简称透

出栈入栈动画demo

项目做了一个切换界面动画的功能,用到了出栈入栈的,写了一个demo package com.myron.stackview; import java.util.Stack; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.view.animation.Animation;

css3 动画demo

1)http://www.yyyweb.com/demo/css-cokecan/inner.html 2)页面切换效果demo http://www.yyyweb.com/demo/page-transitions/ 3)各种loading图标动画 http://www.yyyweb.com/demo/single-loaders/

[iOS 多线程 &amp; 网络 - 3.0] - 在线动画Demo

A.需求 所有数据都从服务器下载 动画列表包含:图片.动画名标题.时长副标题 点击打开动画观看 code source: https://github.com/hellovoidworld/VideoOnlineDemo server source:  https://github.com/hellovoidworld/MyOnlineVideoDemoServer B.实现 1.显示图片和基本信息 服务器端的json信息: { "videos": [ { "name&quo

图片连续切换动画Demo

//连续动画:一个接一个地显示一系列的图像 NSArray *myImages = [NSArray arrayWithObjects: [UIImage imageNamed:@"d.jpg"], [UIImage imageNamed:@"c.jpg"], [UIImage imageNamed:@"b.jpg"], [UIImage imageNamed:@"a.png"], nil]; UIImageView *myA

iOS 完整项目集合 精选好看炫酷的动画DEMO 实用的开发技巧

Dear all:一周一weekly又来啦~很多code友反应weekly精品干货,非常好,非常多哦,建议各位code友如果现在暂时用不到,可以先做收藏哦,以后查用起来也方便哈~不多说进入正题 <ignore_js_op> [一周精品源码] LMLiveStreaming 直播框架[img]file:///C:\Users\zhangjy\AppData\Roaming\Tencent\QQ\Temp\[email protected][GWU0353$FOVS.png[/img]http:/

动画demo

#import "ViewController.h" @interface ViewController () @end @implementation ViewController -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { //  [UIView transitionWithView:self.aView duration:2 options:UIViewAnimationOptionTrans