簡體   English   中英

如何在導航欄中刪除 UITextField 的邊框

[英]How to remove border of UITextField in navigationbar

我想刪除導航欄中的 UItextField 邊框。 我已經瀏覽了這個鏈接,但它不起作用。 (我制作了一個示例應用程序並在 ViewConroller 上添加了 UItextField 所以它工作正常)

如何隱藏 UITextField 邊框?

無法動態刪除 UITextField 的邊框

是否要去除 UITextView 或 UITextField 的邊框? 如果你想在 textField 中刪除它,試試這個:

textField.borderStyle = UITextBorderStyleNone;

嘗試這個:

    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()

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM