2

似乎如果 CALayer、某些 UIViewController 的后代rotatingHeaderViewrotatingFooterView具有掩码,则掩码在自动旋转期间不起作用:

创建此形状的代码:

CAShapeLayer *mask = [CAShapeLayer layer];
mask.path = [UIBezierPath bezierPathWithOvalInRect:CGRectMake(0, 0, 30, 20)].CGPath;

CALayer *l = [CALayer layer];
l.backgroundColor = [UIColor redColor].CGColor;
l.mask = mask;
l.frame = CGRectMake(0, 0, 30, 20);

[self.layer addSublayer:l];

有没有办法解决或解决这个问题?

4

0 回答 0