self.layer.masksToBounds = NO;
self.layer.shadowColor = color.CGColor; // 阴影的颜色
self.layer.shadowOpacity = opacity; // 阴影透明度
self.layer.shadowOffset = CGSizeMake(0,0); // 阴影的范围
self.layer.shadowRadius = spread/2; // 阴影扩散的范围控制
float border=spread/2;
self.layer.shadowOpacity = opacity;
self.layer.masksToBounds = NO;
self.layer.shadowColor = color.CGColor;
self.layer.shadowRadius = border;
self.layer.shadowOffset = CGSizeMake(0,0);
float width = self.bounds.size.width;
float height = self.bounds.size.height;
UIBezierPath* aPath = [UIBezierPath bezierPathWithRect:CGRectMake(-border, -
border, width+border, height+border)];
aPath.lineWidth = border;
aPath.lineCapStyle = kCGLineCapRound;
aPath.lineJoinStyle = kCGLineCapRound;
self.layer.shadowPath = aPath.CGPath;
阴影
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
推荐阅读更多精彩内容
- 只需要对AppBarLayout设置一个属性:app:elevation=”0dp”注意:不要写成Android:...
- 1.边框圆角 在早期如果想要制作四周有圆角的元素时,需要专门制作一张图片(这其实没什么),但是试想一下,如果要修改...
- 个人博客: 斯科特安的时间 1. 问题 带阴影的TextView 淡入淡出动画异常,有多余的阴影 2. 复现步骤 ...