iOS10.3.2上-动画效果无效-原因:??
1. 缩放
if (animated) {
// 第一步:将view宽高缩至无限小(点)
self.finishView.transform = CGAffineTransformScale(CGAffineTransformIdentity,
CGFLOAT_MIN, CGFLOAT_MIN);
[UIView animateWithDuration:0.3 animations:^{
// 第二步: 以动画的形式将view慢慢放大至原始大小的1.2倍
self.finishView.transform =
CGAffineTransformScale(CGAffineTransformIdentity, 1.2, 1.2);
}completion:^(BOOL finished) {
[UIView animateWithDuration:0.2 animations:^{
// 第三步: 以动画的形式将view恢复至原始大小
self.finishView.transform = CGAffineTransformIdentity;
}];
}];
}
2. 平移
// CGAffineTransformMakeTranslation 平移弹出
self.uBAlertView.transform = CGAffineTransformMakeTranslation(0.01, SCREEN_HEIGHT);
[UIView animateWithDuration:0.5 animations:^{
self.uBAlertView.transform = CGAffineTransformMakeTranslation(0.01, 0.01);
}];
// 移除
[UIView animateWithDuration:0.5 animations:^{
self.uBAlertView.transform = CGAffineTransformMakeTranslation(0.01, SCREEN_HEIGHT);
} completion:^(BOOL finished) {
[self.uBAlertView removeFromSuperview];
}];
网友评论