应用中想要给UIButton加一个动画。让按钮能淡出屏幕然后隐藏。
我写的代码,没实现:
[UIView animateWithDuration:1.5
animations:^{
S1Button.frame = CGRectMake(20, 10, 50, 10);
}];
[S1Button setHidden:YES];
break;
应用中想要给UIButton加一个动画。让按钮能淡出屏幕然后隐藏。
我写的代码,没实现:
[UIView animateWithDuration:1.5
animations:^{
S1Button.frame = CGRectMake(20, 10, 50, 10);
}];
[S1Button setHidden:YES];
break;
可以在动画结束后给按钮设置新坐标:
[UIView animateWithDuration:0.9 animations:^{
tradeButton.frame = (CGRect){ CGPointMake(51, 150), tradeButton.bounds.size };
} completion:^(BOOL finished) {
tradeButton.hidden = YES;
// etc.
}];