iOS 边框渐变+圆角
self.bottomView.backgroundColor = [UIColor colorWithWhite:1 alpha:0.1];
CAGradientLayer *gradientLayer = [CAGradientLayer layer];
gradientLayer.frame = self.bottomView.bounds;
gradientLayer.colors = @[(id)[UIColor colorWithHexString:@"#CD66FD"].CGColor, (id)[UIColor colorWithHexString:@"#05DFF8"].CGColor];
CAShapeLayer *maskLayer = [CAShapeLayer layer];
maskLayer.lineWidth = 1.0;
maskLayer.path = [UIBezierPath bezierPathWithRoundedRect:self.bottomView.bounds cornerRadius:6.0].CGPath;
// maskLayer.path = [UIBezierPath bezierPathWithRect:self.bottomView.bounds].CGPath;
maskLayer.fillColor = [UIColor clearColor].CGColor;
maskLayer.strokeColor = [UIColor blackColor].CGColor;
maskLayer.cornerRadius = 6.0; // 添加圆角
gradientLayer.mask = maskLayer;
[self.bottomView.layer addSublayer:gradientLayer];
发表回复