按钮在动画完成后调整回原始大小

时间:2014-11-11 06:11:37

标签: ios objective-c uibutton uiviewanimation

我正试图为一个uibutton的大小调整动画。

问题是,一旦动画完成,它就会恢复到原来的大小。这是什么问题

[UIView animateWithDuration:0.5 animations:^{
    [self.btn1 setFrame:CGRectMake(self.btn1.frame.origin.x, self.btn1.frame.origin.y, self.btn1.frame.size.width, 51)];
    [self.btn2 setFrame:CGRectMake(self.btn2.frame.origin.x, self.btn2.frame.origin.y, self.btn2.frame.size.width, self.btn2.frame.size.height/2)];
    [self.btn3 setFrame:CGRectMake(self.btn3.frame.origin.x, self.btn3.frame.origin.y, self.btn3.frame.size.width, self.btn3.frame.size.height/2)];
} completion:^(BOOL finished) {
    [UIView animateWithDuration:2 delay:0 usingSpringWithDamping:0.5 initialSpringVelocity:20 options:UIViewAnimationOptionCurveEaseIn animations:^{
        [self.slider setFrame:CGRectMake(10, self.slider.frame.origin.y, self.slider.frame.size.width, self.slider.frame.size.height)];
    } completion:^(BOOL finished) {

    }];
}];

0 个答案:

没有答案