[self setMaskTo:yourView byRoundingCorners:UIRectCornerTopLeft|UIRectCornerTopRight]; - (void)setMaskTo:(UIView*)view byRoundingCorners:(UIRectCorner)corners { UIBezierPath *rounded = [UIBezierPath bezierPathWithRoundedRect:view.bounds byRoundingCorners:corners cornerRadii:CGSizeMake(8.0, 8.0)]; CAShapeLayer *shape = [[CAShapeLayer alloc] init]; [shape setPath:rounded.CGPath]; view.layer.mask = shape; }
设置圆角 但未必四个都是圆角
猜你喜欢
转载自wang-peng1.iteye.com/blog/1879888
今日推荐
周排行