【发布时间】:2020-04-30 01:39:25
【问题描述】:
我为三个视图提供了阴影。阴影在 iPhone 8 plus、iPhone 11、iPhone 11 pro max 中完美呈现。如下所示
我在 iPhone 8、iPhone 7 plus、iPhone 7 的右侧出现深黑色阴影,为什么?如下所示
如何在 iPhone8 中去除右侧的黑色。
下面的 UIView 阴影代码:
firstContainerView.clipsToBounds = false
firstContainerView.layer.shadowColor = UIColor.black.cgColor
firstContainerView.layer.shadowOpacity = 1
firstContainerView.layer.shadowOffset = CGSize(width: 0.2, height: 0.2)
firstContainerView.layer.shadowRadius = 1
firstContainerView.layer.shadowPath = UIBezierPath(roundedRect:
firstContainerView.bounds, cornerRadius: cornerRadius).cgPath
为什么某些设备会出现额外的黑色阴影。 请帮我去除 iPhone 8、iPhone 7 plus 阴影中多余的黑色。
【问题讨论】:
标签: swift iphone uiview shadow