在 iOS 7 中,我的 UIButton 标题在错误的时间进出动画 - 延迟。这个问题在 iOS 6 上没有出现。我只是在使用:
[self setTitle:text forState:UIControlStateNormal];
我希望这种情况立即发生并且没有空白框。这种眨眼尤其会分散注意力,并将注意力从其他动画上移开。
最佳答案
使用 performWithoutAnimation:
方法,然后强制布局立即发生,而不是稍后发生。
[UIView performWithoutAnimation:^{
[self.myButton setTitle:text forState:UIControlStateNormal];
[self.myButton layoutIfNeeded];
}];
https://stackoverflow.com/questions/18946490/