2011-04-04 148 views
2

我有4个图像。我想在UIView中逐个添加图像。 请给我任何想法。如何在UIView中添加图像数组。如何将图像添加到UIView

+0

你想为这些图像设置动画? – 2011-04-04 06:49:23

+0

是我想动画这个图像数组一个接一个 – avinash 2011-04-04 06:56:11

+0

我想在每个图像上添加Ken Burns效果 – avinash 2011-04-04 07:00:37

回答

6

它不是从你的问题不清楚,但我猜你婉由一个一段时间的延迟后,显示的图像在你看来一个......如果你愿意,你面包车

[self performSelector:@selector(callFunction) withObject:nil afterDelay:0 ]; 
[self performSelector:@selector(callFunction2) withObject:nil afterDelay:k_AnimateTime ]; 
[self performSelector:@selector(callFunction3) withObject:nil afterDelay:2*k_AnimateTime ]; 
得到它是什么

的功能

imageview = [[[UIImageView alloc] initWithFrame:CGRectMake(x,y,w,h)]autorelease]; 
    imageview.image = [[UIImage imageNamed: [NSString stringWithString:name]]autorelease]; 
    [self.view addSubview:imageview]; 
    imageview.frame = CGRectMake(imageview.frame.origin.x, (imageview.frame.origin.y), imageview.frame.size.width, imageview.frame.size.height); 
    [UIView beginAnimations:nil context:NULL]; 
    [UIView setAnimationDelegate:self]; 
    //[UIView setAnimationWillStartSelector:@selector(Transform2)]; 


    [UIView setAnimationDuration:k_AnimateTime]; 

    [UIView setAnimationBeginsFromCurrentState:YES]; 
    //[UIView setAnimationDidStopSelector:@selector(increaseCount)]; 
    imageview.frame = CGRectMake(imageview.frame.origin.x - Ex, (imageview.frame.origin.y - Ey), imageview.frame.size.width, imageview.frame.size.height); 
    [UIView commitAnimations]; 

    [self.view addSubview:imageview]; 

} 
+0

它的工作,但从头开始如何重复。 – avinash 2011-04-11 07:05:28

+0

没有得到你......? – 2011-04-11 08:46:57

+0

所有动画完成时如何重复功能? – avinash 2011-04-11 09:00:55