弹出动画
//出现
- (void)showAnimal{
self.transform = CGAffineTransformScale(CGAffineTransformIdentity, CGFLOAT_MIN, CGFLOAT_MIN);
[UIView animateWithDuration:0.3 animations:^{
// 以动画的形式将view慢慢放大至原始大小的1.2倍
self.transform = CGAffineTransformScale(CGAffineTransformIdentity, 1.2, 1.2);
} completion:^(BOOL finished) {
[UIView animateWithDuration:0.2 animations:^{
// 以动画的形式将view恢复至原始大小
self.transform = CGAffineTransformIdentity;
}];
}];
}
//隐藏
- (void)hiddenView{
[UIView animateWithDuration:0.2 animations:^{
self.transform = CGAffineTransformScale(CGAffineTransformIdentity, 1.2, 1.2);
} completion:^(BOOL finished) {
[UIView animateWithDuration:0.3 animations:^{
self.transform = CGAffineTransformScale(CGAffineTransformIdentity, 0.001, 0.001);
} completion:^(BOOL finished) {
[self removeFromSuperview];
}];
}];
}
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。