【发布时间】:2012-10-28 03:56:55
【问题描述】:
我正在尝试在淡入阴影的同时缩放我的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 是可动画的?
【问题讨论】:
标签: objective-c ios cocoa-touch quartz-graphics