私はビューを表示および非表示にしてビューをアニメーション化しています。 didSelectRowでこのメソッドを呼び出しています。 セルをクリックすると、ビューを非表示にして、ビューを表示したいとします。しかし、私の問題はアニメーションが起こっているから表示に隠すしかし、ショーから非表示にしないとき。隠すショーは突然起こっていて、滑らかなアニメーションはありません。私はこのコードです。iphone sdkのアニメーション表示に問題がありますか?
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
//[tableView deselectRowAtIndexPath:indexPath animated:YES];
Song *songObj = [songsList objectAtIndex:indexPath.row];
[self hideMsg];
//int delay = 20;
//[self performSelector:@selector(hideMsg) withObject:nil afterDelay:delay];
[self showTitleWithOptions:songObj];
}
- (void)hideMsg;
{
CGRect frame = animatedSubView.frame;//CGRectMake(0,415,360,55)
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:75];
frame.origin.y = 480;// here I'm changing y to 480
animatedSubView.frame = frame;
[UIView commitAnimations];
frame = animatedSubView.frame;// now frame is CGRectMake(0,480,360,55)
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:.75];
frame.origin.y = 415;//now I'm changing y to 415
animatedSubView.frame = frame;
[UIView commitAnimations];
theTableView.frame =CGRectMake(0,230,320,190);
}
ちょっとSrry、ここにコードを貼り付けるときに私はそれを逃しました。私は.75しか保管しなかった。 – praveena
@Praveena更新された回答を参照してください。 –