UIView 的部分圆角的设定

xiaoxiao2021-02-28  35

UIBezierPath*maskPath = [UIBezierPath bezierPathWithRoundedRect:view.bounds byRoundingCorners:(UIRectCornerTopRight | UIRectCornerBottomRight) cornerRadii:CGSizeMake(7.5,7.5)];//圆角大小 CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init]; maskLayer.frame = view.bounds; maskLayer.path = maskPath.CGPath; view.layer.mask = maskLayer;

}

(UIRectCornerTopRight | UIRectCornerBottomRight) 这个控制圆角的位置

转载请注明原文地址: https://www.6miu.com/read-2613507.html

最新回复(0)