2017-09-28 16 views
0

내 앱의 문의 양식에서 텍스트 입력란의 맨 아래에 흰 줄이 표시됩니다.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에 틈새 시장이 있습니까?

답변

2

귀하의 Y 지점에서 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) 
+0

아 예보다 뭔가를 만들 것입니다! 고마워요 Raj. – ochhii