iOS Button切半边圆角

2021-06-10  本文已影响0人  张天奇天张

UIBezierPath *maskOnePath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_WIDTH, 1000) byRoundingCorners:UIRectCornerTopLeft | UIRectCornerBottomLeft cornerRadii:CGSizeMake(18, 18)];

CAShapeLayer *maskOneLayer = [[CAShapeLayer alloc] init];

maskOneLayer.frame = oneBtn.bounds;

maskOneLayer.path = maskOnePath.CGPath;

oneBtn.layer.mask = maskOneLayer;

上一篇下一篇

猜你喜欢

热点阅读