Cocoa touch 应用图层遮罩后,导航栏停止工作

Cocoa touch 应用图层遮罩后,导航栏停止工作,cocoa-touch,ios5,core-graphics,uibezierpath,cashapelayer,Cocoa Touch,Ios5,Core Graphics,Uibezierpath,Cashapelayer,我使用CAShapeLayer创建了一个遮罩,我在左上/右上角给出了圆角,然后将其应用到我的navigationController的导航栏上 它就像一个符咒,但我现在注意到我不能使用导航栏上的按钮 以下是我在viewDidLoad中使用的代码: 设置图层蒙版后,您需要以编程方式设置按钮。这是什么意思?如何设置它们? UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:self.navigationController

我使用CAShapeLayer创建了一个遮罩,我在左上/右上角给出了圆角,然后将其应用到我的navigationController的导航栏上

它就像一个符咒,但我现在注意到我不能使用导航栏上的按钮

以下是我在viewDidLoad中使用的代码:


设置图层蒙版后,您需要以编程方式设置按钮。

这是什么意思?如何设置它们?
UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:self.navigationController.navigationBar.bounds
                                               byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight
                                                     cornerRadii:CGSizeMake(6.0, 6.0)];

CAShapeLayer *maskLayer = [CAShapeLayer layer];
maskLayer.frame = self.navigationController.navigationBar.bounds;
maskLayer.path = maskPath.CGPath;

self.navigationController.navigationBar.layer.mask = maskLayer;