zoukankan      html  css  js  c++  java
  • 封装出来的小动画,视图正在加载时的动画

    //
    //  LoadImageView.h
    //  WisdomShope
    //
    //  Created by mac on 15/12/26.
    //  Copyright (c) 2015年 ZY. All rights reserved.
    //
    
    #import <UIKit/UIKit.h>
    
    @interface LoadImageView : UIImageView
    //开始动画
    - (void)startImageAnimation:(NSString *)imgName Count:(int)count;
    //停止动画
    - (void)stopImageAnimation;
    //清除动画
    - (void)clear;
    
    @end
    //
    //  LoadImageView.m
    //  WisdomShope
    //
    //  Created by mac on 15/12/26.
    //  Copyright (c) 2015年 ZY. All rights reserved.
    //
    
    #import "LoadImageView.h"
    
    @implementation LoadImageView
    
    - (id)initWithFrame:(CGRect)frame{
        
        if(self = [super initWithFrame:frame]){
            
            
        }
        
        return self;
    }
    
    - (void)startImageAnimation:(NSString *)imgName Count:(int)count{
        NSMutableArray* a1=[[NSMutableArray alloc]init];
        NSString* a2;
        
        for (int i = 1; i <= count; i++) {
            
            a2=[NSString stringWithFormat:@"%@%d",imgName,i];
            
            UIImage* im1=[UIImage imageNamed:a2];
            [a1 addObject:im1];
        }
        self.animationImages=a1;
        self.animationDuration= .5;
        self.animationRepeatCount=0;
        [self startAnimating];
    
        
    }
    
    - (void)stopImageAnimation{
        
        [self stopAnimating];
        
    }
    - (void)clear{
        self.animationImages=nil;
        [self removeFromSuperview];
    }
    
    @end
  • 相关阅读:
    基于ModBus-TCP/IT 台达PLC 通讯协议解析
    TNS-12541: TNS: 无监听程序 解决方案
    一个很好的ping端口的工具
    上位机(开发)
    无名
    网站部署
    cordova 开发
    mono 开发
    调用 浏览器 插件
    MacBook 配置
  • 原文地址:https://www.cnblogs.com/zxh-iOS/p/5083603.html
Copyright © 2011-2022 走看看