我们前段时间实现了一个应用程序,它在蒙版视图后面做动画:
UIBezierPath *myBezierPath = myVectorDrawing.bezier;
CAShapeLayer *myShapeLayer = [CAShapeLayer layer];
myShapeLayer.path = myBezierPath.CGPath;
debugLog(@"wize: height%f width%f",myShapeLayer.frame.size.height, myShapeLayer.frame.size.width);
CAShapeLayer *maskWithHole = [CAShapeLayer layer];
maskWithHole.frame = self.mask.layer.bounds;
UIBezierPath *maskPath = [UIBezierPath bezierPath];
[maskPath moveToPoint:CGPointMake(CGRectGetMinX(maskWithHole.frame), CGRectGetMinY(maskWithHole.frame))];
[maskPath addLineToPoint:CGPointMake(CGRectGetMinX(maskWithHole.frame), CGRectGetMaxY(maskWithHole.frame))];
[maskPath addLineToPoint:CGPointMake(CGRectGetMaxX(maskWithHole.frame), CGRectGetMaxY(maskWithHole.frame))];
[maskPath addLineToPoint:CGPointMake(CGRectGetMaxX(maskWithHole.frame), CGRectGetMinY(maskWithHole.frame))];
[maskPath addLineToPoint:CGPointMake(CGRectGetMinX(maskWithHole.frame), CGRectGetMinY(maskWithHole.frame))];
[maskPath appendPath:myBezierPath];
[maskWithHole setPath:[maskPath CGPath]];
[maskWithHole setFillRule:kCAFillRuleEvenOdd];
[maskWithHole setFillColor:[[UIColor blackColor] CGColor]];
self.mask.layer.mask = maskWithHole;
self.mask.layer.masksToBounds = NO;
在所有设备/iOS 版本上,新 iPad Air 没有任何问题,它在被遮盖的区域有大量闪烁。Apple 是否因为 64 位架构而改变了什么?
任何帮助表示赞赏。