我正在尝试在视图中制作动画,然后将其设置为动画。我的代码看起来像这样
- (void) animateIn{
self.contentView.alpha = 0.0;
self.contentView.transform = CGAffineTransformMakeScale(0.1, 0.1);
[UIView animateWithDuration:0.4 delay:0.0 usingSpringWithDamping:0.6 initialSpringVelocity:0.0 options:0 animations:^{
self.contentView.alpha = 1.0;
self.contentView.transform = CGAffineTransformIdentity;
} completion:nil];
}
- (void) animateOut{
[UIView animateWithDuration:0.4 animations:^{
self.contentView.alpha = 0.0;
self.contentView.transform = CGAffineTransformMakeScale(0.1, 0.1);
}];
}
动画效果很好。动画输出没有。动画看起来像视图增长得非常快。
知道我做错了吗?