shadowpath

UIView's shadowpath color doesn't change

走远了吗. 提交于 2019-12-17 21:24:11
问题 I have a UIView and I set a shadowPath for it like this: func addShadow() { let cornerRadius: CGFloat = self.containerView.frame.height/2 self.containerView.layer.shadowPath = UIBezierPath(roundedRect: self.containerView.frame, cornerRadius: cornerRadius).cgPath self.containerView.layer.shadowRadius = cornerRadius self.containerView.layer.shadowOffset = .zero self.containerView.layer.shadowOpacity = 0.2 self.containerView.layer.cornerRadius = cornerRadius self.containerView.layer.shadowColor