很常ios开发记录

ios 设置阴影

2021-03-16  本文已影响0人  缘來諟夢

// // 即阴影颜色值
// self.layer.shadowColor = [UIColor colorWithRed:194/255.0 green:194/255.0 blue:194/255.0 alpha:0.4].CGColor;
// // 阴影的位置
// self.layer.shadowPath = [UIBezierPath bezierPathWithRect:self.bounds].CGPath;
// // 即阴影相对于Y轴有3个像素点的向下位移
// self.layer.shadowOffset = CGSizeMake(0, 3);
// //设置阴影的不透明度
// self.layer.shadowOpacity = 1;
// // 阴影的模糊度
// self.layer.shadowRadius = 5;
// //设置抗锯齿边缘
// self.layer.rasterizationScale = [UIScreen mainScreen].scale;
//
// self.clipsToBounds = NO;

上一篇 下一篇

猜你喜欢

热点阅读