关于动画的切换可以用UIImageView中的属性来实现。

来源:互联网 发布:导弹坐标系转换软件 编辑:程序博客网 时间:2024/06/10 13:21

此属性:

@property(nonatomic,copy)NSArray *animationImages;           // The array must contain UIImages. Setting hides the single image. default is nil



用法:
        

      1.@property (nonatomic,retain) UIImageView *voice;//声明声音图片


      2.self.voice.image = [UIImageimageNamed:@"chat_animation_white3”];//声音图片默认状态`

      3.self.voice.animationImages = [NSArrayarrayWithObjects:

                                      [UIImageimageNamed:@"chat_animation_white1"],

                                      [UIImageimageNamed:@"chat_animation_white2"],

                                      [UIImageimageNamed:@"chat_animation_white3"],nil]; //图片动画所要用到的图片组。

        self.voice.animationDuration =1;   //每隔一秒切换一张图片

        self.voice.animationRepeatCount =0; //无限重复执行。  1:执行一次。2:执行两次。。。依次类推,只有0为执行无数次。

      

       self.voice.userInteractionEnabled =NO;//图片不可点。YES为可点。






0 0
原创粉丝点击