-1

UIImageView配列に4つの画像を入れる方法は? forloop が実行できないのはなぜですか?

4 つの画像で 4 つのフレームを作成したい場合、どうすればよいですか?

    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];
   }
4

2 に答える 2

0
NSArray *photos = [NSArray arrayWithObjects:
                    [UIImage imageNamed:@"1.jpg"],
                    [UIImage imageNamed:@"2.jpg"],
                    [UIImage imageNamed:@"3.jpg"],
                    [UIImage imageNamed:@"4.jpg"],nil]; 
UIImageView *imgView = [[UIImageView alloc]init];
imgView.animationImages = photos;
于 2012-11-24T09:23:10.187 に答える