在列中添加图像

时间:2012-09-01 16:24:00

标签: iphone objective-c ios image animation

请求帮助。在列中组织一些图像的最佳方法是,根据已添加的图片数量,轻松计算img添加的动画。 图片 - http://bit.ly/OBK8xk 非常感谢。厌倦了英语。

1 个答案:

答案 0 :(得分:0)

你可以使用for循环。例如。动态图像可以通过在数组中获取(imagearray)来实现。然后尝试这段代码

static int statvar = 0;
for(int i=0;i<[imagearray count];i++)
{
    UIImageView* imgView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 10+statvar, 50, 50)];
    [imgView  setImage:[UIImage imageNamed:@"arrow.png"]]
    statvar+=55;
    [self.view addsubview:imgView];
}