最佳答案
虽然这是可能的,但有点棘手,它需要您使用 CGPath
绘制阴影:https://developer.apple.com/documentation/quartzcore/calayer/1410771-shadowpath
可能更简单的方法是使用可调整大小的图像:https://developer.apple.com/documentation/uikit/uiimage/1624102-resizableimage
你可以制作一个像下面这个模拟的较小的图像,然后像这样简单地调整它的大小来增加框架:
let resized = mockImage.resizableImage(withCapInsets: UIEdgeInsets(top: 16, left: 16, bottom: 16, right: 56), resizingMode: .stretch)
关于ios - 带圆角的底部内部阴影,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55147578/