我尝试使用此代码将图像视图添加到UIView:
for (int i = 0; i <numberOfImages; i++) {
UIImageView *image = [UIImageView alloc]initWithFrame:CGRectMake(40, 40, 40, 40)];
image.image = [images objectAtIndex:i];
[self.view addSubview:image];
}
Run Code Online (Sandbox Code Playgroud)
这有效,但问题是我希望在添加每个图像之前有5秒的延迟,而是将它们全部添加到同一时间.有人可以帮帮我吗?谢谢.
例:
5 seconds = one image on screen
10 seconds = two images on screen
15 seconds = three images on screen
Run Code Online (Sandbox Code Playgroud)