【发布时间】:2015-11-19 06:01:01
【问题描述】:
我正在使用下面的代码为 tableView 的底部边缘制作圆角
CALayer *capa = self.patientTableView.layer;
//Round
CGRect bounds = capa.bounds;
UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:bounds
byRoundingCorners:(UIRectCornerBottomLeft | UIRectCornerBottomRight)
cornerRadii:CGSizeMake(10.0, 10.0)];
CAShapeLayer *maskLayer = [CAShapeLayer layer];
maskLayer.frame = bounds;
maskLayer.path = maskPath.CGPath;
[capa addSublayer:maskLayer];
capa.mask = maskLayer;
这段代码运行良好,但 tableview 没有显示低于其框架高度的内容(但它滚动到它的 offset.y)。
【问题讨论】:
-
顺便说一句,您不必将遮罩层添加为子层。只需设置现有层的
mask属性就足够了。
标签: ios uitableview calayer