试图改变一个UIImageView:10秒 [英] Trying to change a UIImageView each 10 seconds

查看:93
本文介绍了试图改变一个UIImageView:10秒的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,我有我的观点之一的UIImageView。我想改变形象每隔10秒,但我没有我怎样才能让它在任何想法。

Well, I have a UIImageview in one of my views. I would like to change the image every 10 seconds, but I don't have any idea of how can I make it.

任何建议?

推荐答案

首先创建图像的数组。

NSArray *images = [NSArray arrayWithObjects:[UIimage imagenamed:@"image1.png"],[UIimage imagenamed:@"image2.png"],[UIimage imagenamed:@"image3.png"],[UIimage imagenamed:@"image4.png"]]];

然后设置阵列的UIImageViewsanimationImages的属性。

Then set array to UIImageViews "animationImages"property

imageView.animationImages = images;

将时间设置为动画。

Set time for animation.

imageView.animationDuration = 10;

开机动画..

[imageView startAnimating];

要停止动画只是这样做

[imageView stopAnimating];

pretty简单..

Pretty simple..

这篇关于试图改变一个UIImageView:10秒的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆