2010-03-17 67 views

回答

5

如果你想有一個褪色,你就必須修改您的附屬視圖,而不是重置cell.accessoryView。最簡單的方法可能是給你的配件兩個子視圖,分別爲picture1和picture2。

UIImageView *imageView1 = [[[UIImageView alloc] init] autorelease]; 
UIImageView *imageView2 = [[[UIImageView alloc] init] autorelease]; 
imageView2.alpha = 0; 
[cell.accessoryView addSubview:imageView1]; 
[cell.accessoryView addSubview:imageView2]; 

然後執行以下之間褪色:

[UIView beginAnimations:@"" context:nil]; 
imageView1.alpha = 0; 
imageView2.alpha = 1; 
[UIView commitAnimations]; 
+0

感謝湯姆讓我試試 – RAGOpoR 2010-03-17 08:07:48

6

如果我正確地理解你的問題......

你可以嘗試像

//-------fade out 

- (void)animateFadingOut{ 

[UIView beginAnimations:nil context:nil]; 

[UIView setAnimationDuration:1.0]; 

[UIView setAnimationDidStopSelector:@selector(animateFadingIn)]; 

[UIView setAnimationDelegate:self]; 

//set transformation 
[cell.accessoryView addSubview:NewImgeView]; 
cell.accessoryView.alpha = 0.0; 

[UIView commitAnimations]; 

} 
-(void)animateFadingIn{ 

[UIView beginAnimations:nil context:nil]; 

[UIView setAnimationDuration:1.0]; 

[UIView setAnimationDelegate:self]; 

//set transformation 
cell.accessoryView.alpha = 1.0; 

[UIView commitAnimations]; 

} 
+0

thnaks mihirpmehta讓我試試 – RAGOpoR 2010-03-17 06:25:52

+0

感謝它的工作相當順利 – RAGOpoR 2010-03-17 06:36:11