【发布时间】:2012-06-15 17:21:11
【问题描述】:
我正在尝试仅舍入我的表格视图的右上角和左上角。我正在使用下面的代码,它似乎只是在左上角四舍五入......
CAShapeLayer *topLayer = [CAShapeLayer layer];
UIBezierPath *roundedPath =
[UIBezierPath bezierPathWithRoundedRect:self.bounds byRoundingCorners:UIRectCornerTopRight | UIRectCornerTopLeft cornerRadii:CGSizeMake(9.f, 9.0f)];
topLayer.path = [roundedPath CGPath];
【问题讨论】:
-
stackoverflow.com/a/5826698/855738 我用这个答案做了几乎同样的事情
-
知道它是一个旧帖子,但要确保你有。 [tableView.layer setMasksToBound: YES] 应该没问题
-
查看接受的答案 [此处][1]。可能是同一个问题。 [1]:stackoverflow.com/questions/26934231/…
标签: ios rounded-corners uibezierpath uitableview