How to Create Custom UITableViewCell Editing Transition?
I have a custom UITableViewCell which has an image & and some text. When entering editing mode, I would like the image to fade out & move offscre开发者_JAVA百科en to the left. When & how do I implement this code? I tried putting an animation block in willTransitionToState: but the image simply jumps offscreen w/ no animation.
Override setEditing:animated:
to do this type of thing. Make sure you don't animate if animated
is NO
. Like so:
if( animated ) {
[UIView beginAnimations:@"EnterEditingMode" context:NULL];
// Set up duration, etc here
}
if( editing ) {
// do animation
} else {
// reverse animation
}
if( animated ) {
[UIView commitAnimations];
}
精彩评论