我有一点说是这样的代码:
//up till now someButton's alpha was 1
someButton.alpha = 0;
[UIView animateWithDuration:.25
delay:0.0
options:kMaskEaseOut
animations:^ {
someButton.alpha = 1;
}
completion:^ (BOOL finished){}];
问题是动画开始之前someButton的阿尔法没有设置为0,即没有发生视觉。 现在,如果我注释掉整个动画块它的确会someButton的alpha设置为0。另外,如果我这样做:
[UIView animateWithDuration:0
delay:0.0
options:kMaskEaseOut
animations:^ {
someButton.alpha = 0;
} completion:^ (BOOL finished){
[UIView animateWithDuration:.25
delay:0.0
options:kMaskEaseOut
animations:^ {
someButton.alpha = 1;
}
completion:^ (BOOL finished){}];
}];
它工作正常(我开始一个0长度的动画动画后),这是一种愚蠢的。