2017-01-07 14 views
-1

ナビゲーションバーにあるUItextFieldボーダーを削除します。私はこのリンクを通過しましたが、動作していません。 (それが正常に動作しているので、私は、サンプルアプリを作ってViewConroller上のUITextFieldを追加しました)ナビゲーションバーのUITextFieldのボーダーを削除する方法

How to hide UITextField border?

Cannot remove border of UITextField dynamically

+0

[はい 'textfield.layer.borderWidth = 0 ' – kamwysoc

+0

を試してみたが、境界はまだ表示されませんでした。 –

+0

あなたのUIスクリーンショットを投稿してください。 –

答えて

0

あなたはUITextViewまたはUITextFieldのの境界線を削除しますか? あなたはこのを試してみてくださいTextField内でを削除する場合:

textField.borderStyle = UITextBorderStyleNone; 
+0

はい私はすでにこれを使用しています –

+0

いくつかのコードを投稿できますか? – Gulliva

0

はこれを試してみてください:

textField = subview as! UITextField 
    textField.borderStyle = .None 
    textField.layer.borderWidth = 1 
    textField.layer.borderColor = UIColor.lightGrayColor().CGColor 
    textField.layer.cornerRadius = 14 
    textField.background = nil; 
    textField.backgroundColor = UIColor.whiteColor() 
関連する問題