我正在尝试找到一种方法来为 UIView 的 3D 旋转设置动画。如果您选择“横幅”样式,我希望它看起来像推送通知的动画。我正在尝试使用类似的东西
CABasicAnimation *anim = [CABasicAnimation animationWithKeyPath:@"transform"];
CATransform3D t = CATransform3DIdentity;
t = CATransform3DTranslate(t, 0, -self.bounds.size.height/2, 0);
t = CATransform3DRotate(t, M_PI_2, 1, 0, 0);
t = CATransform3DTranslate(t, 0, -self.bounds.size.height/2, 0);
[anim setFromValue:[NSValue valueWithCATransform3D:CATransform3DIdentity]];
[anim setToValue:[NSValue valueWithCATransform3D:t]];
anim.removedOnCompletion = NO;
[anim setDuration:0.25];
anim.fillMode = kCAFillModeForwards;
anim.delegate = self;
[self.layer addAnimation:anim forKey:@"Rotation"];
但这看起来很扁平,不像推送通知的横幅那么逼真的 3D。我怎样才能使这个动画更逼真?