【发布时间】:2012-11-24 09:12:00
【问题描述】:
如何将四个图像放入一个 UIImageView 数组中? 为什么我的forloop不能运行?
如果我想用四个图像创建四个帧,该怎么做?
NSArray *photos = [NSArray arrayWithObjects:
[UIImage imageNamed:@"1.jpg"],
[UIImage imageNamed:@"2.jpg"],
[UIImage imageNamed:@"3.jpg"],
[UIImage imageNamed:@"4.jpg"],nil];
for(int i=0;i<5;i++)
{
UIImage *image = [UIImage imageNamed:[photos objectAtIndex:i]];
UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
}
【问题讨论】:
-
解释更多。您想使用四张图片作为动画吗?
-
如果我添加这个forloop,它会崩溃。
-
for(int i=0;i
标签: nsstring uiimageview uiimage nsarray