2011-04-04 208 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