错误示例
此UITextView的设置: textView.clipToBounds = true
代表:
func textViewDidEndEditing(_ textView: UITextView) {
changeUIViewStyle(textView, borderWidth: 0, cornerRadius: 0, boderColor: UIColor.defaulfGray)
}
func changeUIViewStyle(_ view: UIView, borderWidth: CGFloat, cornerRadius: CGFloat, boderColor: UIColor?) {
view.borderWidth = borderWidth
view.cornerRadius = cornerRadius // If this line is commented, then bug will gone
view.borderColor = boderColor
}
为什么吗 如果更改了角半径线,则bug将消失。