首页 > 解决方案 > ios objective-c 中的 uitableviewcell 内的一侧角半径问题

问题描述

我正在尝试使用 UIBezierPath 类绘制一个边角半径,但它不会占用 UITableviewcell 内的整个宽度。我应该怎么办?

在此处输入图像描述

UIBezierPath *maskPath1 = [UIBezierPath bezierPathWithRoundedRect:customCell.interviewAutoBtnOutlet.bounds byRoundingCorners:(UIRectCornerTopRight) cornerRadii:CGSizeMake(5.0,5.0)];

                                 CAShapeLayer *maskLayer1 = [[CAShapeLayer alloc] init];
                                 maskLayer1.frame = customCell.interviewAutoBtnOutlet.bounds;
                                 maskLayer1.path  = maskPath1.CGPath;
                                 customCell.interviewAutoBtnOutlet.layer.mask = maskLayer1;

                                 CAShapeLayer *borderLayer1 = [[CAShapeLayer alloc] init];
                                 borderLayer1.frame = self.view.bounds;
                                 borderLayer1.path  = maskPath1.CGPath;
                                 borderLayer1.lineWidth   = 3.0f;
                                 borderLayer1.strokeColor = [UIColor clearColor].CGColor;
                                 borderLayer.fillColor   = [UIColor clearColor].CGColor;
         [customCell.interviewAutoBtnOutlet.layer addSublayer:borderLayer1];

标签: iosobjective-cuitableviewuibezierpathcornerradius

解决方案


推荐阅读