我试图UIView
在我淡入阴影的同时缩放我的,使用以下:
myController.view.layer.shadowOffset = CGSizeMake(0, 3);
myController.view.layer.shadowColor = [UIColor blackColor].CGColor;
myController.view.layer.shadowOpacity = 0.0;
myController.view.layer.shadowPath = [UIBezierPath bezierPathWithRect:myController.view.bounds].CGPath;
[UIView animateWithDuration:0.3
animations:^{
//shrink the view
myController.view.transform = CGAffineTransformMakeScale(0.8, 0.8);
//fade in the shadow
myController.view.layer.shadowOpacity = 0.8;
}
completion:^(BOOL finished){
...etc
视图正确调整大小,但阴影立即出现而不是淡入。
难道我做错了什么?我以为shadowOpacity
是动画的?