Iphone 设置编辑时如何设置帧动画

Iphone 设置编辑时如何设置帧动画,iphone,ios,cocoa-touch,uitableview,transition,Iphone,Ios,Cocoa Touch,Uitableview,Transition,我想平滑过渡复选框和noteButton,如textLabel。我尝试了此代码,但不起作用: - (void)setEditing:(BOOL)editing animated:(BOOL)animated { if (self.editing == NO) { self.checkBox.frame = CGRectMake(50, 0, 50, 50); self.noteButton.frame = CGRectMake(100, 0, 50, 5

我想平滑过渡复选框和noteButton,如textLabel。我尝试了此代码,但不起作用:

- (void)setEditing:(BOOL)editing animated:(BOOL)animated {

    if (self.editing == NO) {
        self.checkBox.frame = CGRectMake(50, 0, 50, 50);
        self.noteButton.frame = CGRectMake(100, 0, 50, 50);
        self.textLabel.frame =  CGRectMake(95,0, 213, 48);
    } else {
        self.checkBox.frame = CGRectMake(10, 0, 50, 50);
        self.noteButton.frame = CGRectMake(50, 0, 50, 50);
        self.textLabel.frame =  CGRectMake(95,0, 213, 48);
    }
    [super setEditing:editing animated:animated];
}
试着在室内做

- (void) layoutSubviews {
  if (self.editing == NO) {
    self.checkBox.frame = CGRectMake(50, 0, 50, 50);
    self.noteButton.frame = CGRectMake(100, 0, 50, 50);
    self.textLabel.frame =  CGRectMake(95,0, 213, 48);
  } else {
    self.checkBox.frame = CGRectMake(10, 0, 50, 50);
    self.noteButton.frame = CGRectMake(50, 0, 50, 50);
    self.textLabel.frame =  CGRectMake(95,0, 213, 48);
  }
}
这应该行得通

- (void)setEditing:(BOOL)editing animated:(BOOL)animated {
    [UIView beginAnimations:@"ResizeAnimation" context:NULL];
    [UIView setAnimationDuration:0.7f];
    if (self.editing == NO) {
        self.checkBox.frame = CGRectMake(50, 0, 50, 50);
        self.noteButton.frame = CGRectMake(100, 0, 50, 50);
        self.textLabel.frame =  CGRectMake(95,0, 213, 48);
    } else {
        self.checkBox.frame = CGRectMake(10, 0, 50, 50);
        self.noteButton.frame = CGRectMake(50, 0, 50, 50);
        self.textLabel.frame =  CGRectMake(95,0, 213, 48);
    }
    [UIView commitAnimations];
    [super setEditing:editing animated:animated];
}