CALayer未显示iOS8
问题描述:
在我的应用的联系表单中,文本输入字段在框的底部有一条白线。CALayer未显示iOS8
let border = CALayer()
border.frame = CGRect(x: 0, y: textInput.frame.height, width: textInput.frame.width, height: 3)
border.borderColor = UIColor.white.cgColor
border.borderWidth = 3
textInput.layer.addSublayer(border)
所需边框在iOS10上显示正常,但在iOS8上测试时不显示。
有没有一些利基,我不知道iOS 8?
答
你Ÿ点是TextInput的高度使它0或东西小于高度
let border = CALayer()
border.frame = CGRect(x: 0, y: textInput.frame.height - 3, width: textInput.frame.width, height: 3)
border.borderColor = UIColor.white.cgColor
border.borderWidth = 3
textInput.layer.addSublayer(border)
是啊!谢谢Raj。 – ochhii