ios - 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];
解决方案
推荐阅读
- javascript - 如何在 d3 中使用高标准差高斯模糊?
- hibernate - Spring批处理程序中的HibernateItemWriter尝试在不开始事务的情况下运行
- xml - 当我尝试验证 XSD 文档时出现问题
- python - 关于 pyinstaller 的路径问题
- r - R语言函数中的函数
- python - 只允许登录用户访问 URL
- react-data-grid - 为什么用 -1 的参数调用 rowGetter?
- django - 在 Django 中比较 HTML 中的两个变量
- react-native - AsyncStorage.clear() 没有清理密钥
- reporting-services - 当主报表参数是 LIKE 运算符的一部分时,子报表不显示