开发者

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];
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜