2017-09-28 3 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

関連する問題