2009-09-24 17 views

回答

0

事情是這樣的:

UIImageView *img = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"someImage.png"]]; 

CGRect endFrame = img.frame; 
CGRect startFrame = img.frame; 

startFrame.size.height = 0; 
img.frame = startFrame; 

[view addSubview:img]; 

[UIView beginAnimations:nil context:nil]; 
[UIView setAnimationDuration: 0.5]; 

img.frame = endFrame; 

[UIView commitAnimations]; 
+0

這工作得很好,但我期待一個不同的動畫: 你的代碼是這樣一個轉變,但我想「逐行」,顯示圖片... – strange99 2009-09-25 09:14:47

+0

我當時感到困惑。你是什​​麼意思「逐行」? – pzearfoss 2009-09-25 13:56:01

+0

我會盡力解釋: 如你所記得的,如果你的連接速度非常慢,(可能使用調制解調器),下載的圖像從上到下顯示(緩慢)。這就是我想要的(就像掃描儀掃描..) – strange99 2009-09-30 11:44:42