Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone UIView中的幻灯片放映_Iphone_Objective C_Cocoa Touch - Fatal编程技术网

Iphone UIView中的幻灯片放映

Iphone UIView中的幻灯片放映,iphone,objective-c,cocoa-touch,Iphone,Objective C,Cocoa Touch,我需要用UIImageView在UIView中实现幻灯片放映。是否有代码在运行时使用计时器加载图像视图?如果任何人可以提供代码,这将是有益的。 提前感谢….使用代码为视图设置动画 Use this one: NSArray *imageArray = [NSArray arrayWithObjects: [UIImage imageNamed:@"nature1.png"], [UIImage imageNamed:@"nature2.png"], [UIImage imageNamed:@"

我需要用UIImageView在UIView中实现幻灯片放映。是否有代码在运行时使用计时器加载图像视图?如果任何人可以提供代码,这将是有益的。
提前感谢….

使用代码为视图设置动画

Use this one:

NSArray *imageArray = [NSArray arrayWithObjects: [UIImage imageNamed:@"nature1.png"], [UIImage imageNamed:@"nature2.png"], [UIImage imageNamed:@"nature3.png"], [UIImage imageNamed:@"nature4.png"],[UIImage imageNamed:@"nature5.png"],[UIImage imageNamed:@"nature6.png"] nil];
UIImageView *slidShowImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0,0,320,480)];
slidShowImageView.animationImages = imageArray; 
slidShowImageView.animationDuration = 0.25; 
 slidShowImageView.animationRepeatCount = 0; 
[slidShowImageView startAnimating]; 
[self addSubview:slidShowImageView]; 
[slidShowImageView release]; 
UIImageView*campFireView=[[UIImageView alloc]initWithFrame:self.view.frame]

// load all the frames of our animation
campFireView.animationImages = [NSArray arrayWithObjects:    
                                [UIImage imageNamed:@"welcome-1.tiff"],
                                [UIImage imageNamed:@"welcome-2.tiff"],
                                [UIImage imageNamed:@"welcome-3.tiff"],
                                nil];

// all frames will execute in 1.75 seconds
campFireView.animationDuration = 1.00;
// repeat the annimation forever
campFireView.animationRepeatCount = 0;
// start animating
[campFireView startAnimating];
// add the animation view to the main window 
[self.view addSubview:campFireView];