Ios 阴影在设备定向过程中出错
我将向视图添加阴影(包括阴影路径,以便性能更好),如下所示:Ios 阴影在设备定向过程中出错,ios,rotation,calayer,Ios,Rotation,Calayer,我将向视图添加阴影(包括阴影路径,以便性能更好),如下所示: CALayer *layer=aView.layer; layer.shadowColor=[UIColor blackColor].CGColor; layer.shadowOpacity=0.8f; layer.shadowOffset=CGSizeMake(4.0f,4.0f); layer.shadowRadius=6.0f; layer.masksToBounds=NO; layer.shouldRasterize=YES;
CALayer *layer=aView.layer;
layer.shadowColor=[UIColor blackColor].CGColor;
layer.shadowOpacity=0.8f;
layer.shadowOffset=CGSizeMake(4.0f,4.0f);
layer.shadowRadius=6.0f;
layer.masksToBounds=NO;
layer.shouldRasterize=YES;
layer.shadowPath=[UIBezierPath bezierPathWithRect:aView.bounds].CGPath;
但是,当设备旋转且图幅改变时,阴影会出错(长距离偏移等)
我曾尝试在layoutSubviews方法中重置阴影,但在旋转过程中,您可以看到阴影在屏幕上移动
旋转期间处理阴影路径的正确方法是什么
(作为最后手段,我正在移除阴影,然后在旋转后将其放回,但它很笨重,并且必须在控制器完成设备定位后告知我的视图:
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
有没有更好的方法让视图知道旋转已完成?这也是我的问题!:(这也是我的问题!:(