常用代码片段
作者:
蓝天白云_Sam | 来源:发表于
2022-06-04 11:29 被阅读0次
View 特效
半边圆角
- (void)makecornerRadiusByRoundingCorners:(UIRectCorner)roundingCorners cornerRadii:(CGSize)cornerRadii
{
UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:self.bounds byRoundingCorners:roundingCorners cornerRadii:cornerRadii];
CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
maskLayer.frame = self.bounds;
maskLayer.path = maskPath.CGPath;
self.layer.mask = maskLayer;
}
渐变
本文标题:常用代码片段
本文链接:https://www.haomeiwen.com/subject/tmkhmrtx.html
网友评论