zoukankan      html  css  js  c++  java
  • iOS中图片动画的三种模式及基本的代码实现

    -(void)play

    {

        //第一种图片动画模式 头尾方式

           //头尾方式

        [UIView beginAnimations:nil context:nil];//动画开始

        [UIView setAnimationDuration:10];//设置动画播放时长

        /*内部写图片处理*/

        [UIView commitAnimations];//提交动画

        //第二种方式:图片动画结束处理模式

        [UIView animateWithDuration:10 animations:^{

            /*图片处理操作*/

        } completion:^(BOOL finished) {

            if(finished)

            {

                    /*动画结束播放的操作,可以设置控件的浅入淡出效果*/

            }

        }];

        //第三种方式;序列帧方式

        UIImageView *image=[[UIImageView alloc]init];

        image.animationDuration=3;//设置动画时长

        [image setAnimationImages:[NSArray new]];//设置图片资源,用来播放,像放电影

        image.animationRepeatCount=1;//设置播放次数

        [image startAnimating];//开始动画

        [image isAnimating];//判断动画是否执行完成

        [image stopAnimating];//结束动画

    }

  • 相关阅读:
    CSS
    CSS
    HTML
    HTML
    HTML
    ubuntu server安装的一些坑
    Haproxy 开启日志记录
    nginx反向代理时保持长连接
    最简单的tomcat安装部署
    nginx的安装部署以及使用
  • 原文地址:https://www.cnblogs.com/tangranyang/p/4505021.html
Copyright © 2011-2022 走看看