ios - 如何制作如下所示的书籍封面阴影
问题描述
我需要右左和下阴影UIImageView
不低于尝试下面的阴影代码但没有按预期工作
viewCheck.layer.shadowRadius = 1.5f;
viewCheck.layer.shadowColor = [UIColor colorWithRed:176.f/255.f green:199.f/255.f blue:226.f/255.f alpha:1.f].CGColor;
viewCheck.layer.shadowOffset = CGSizeMake(0.0f, 0.0f);
viewCheck.layer.shadowOpacity = 0.9f;
viewCheck.layer.masksToBounds = NO;
UIEdgeInsets shadowInsets = UIEdgeInsetsMake(0, 0, -1.5f, 0);
UIBezierPath *shadowPath = [UIBezierPath
bezierPathWithRect:UIEdgeInsetsInsetRect(viewCheck.bounds, shadowInsets)];
viewCheck.layer.shadowPath = shadowPath.CGPath;
解决方案
推荐阅读
- reactjs - 为什么在使用酶的“挂载”功能时,我的玩笑模拟功能不会与模拟对象一起执行?
- python - cx_Freeze 缺少模块
- database - Symfony4 具有相同结构的多个数据库
- python - 获取像素位置
- javascript - 使用扩展运算符的 ES6 对象克隆也在修改输入
- javascript - 使用 mousemove 事件转换 jQuery 眼瞳跟踪器
- node.js - 如何在 Ubuntu 18.10 中安装 Node Js?
- jqgrid - JQGrid 本地搜索多列
- c# - “您的意思是运行 dotnet SDK 命令吗?请在 Windows 命令提示符下安装 dotnetsdk”
- python - 通过蓝牙将音乐从带有 Ubuntu 的 PC 流式传输到音频设备