UIAlertController TextField BorderStyle,IOS

时间:2017-11-08 18:41:30

标签: c# ios uialertcontroller uitextborderstyle

我创建了一个UIAlertController,在AlertController中我添加了一个UITextfield,我希望它没有任何类型的边框。 下面有一个带边框的图片,我想删除那个方形边框。

我想最终得到一个非边框的TextField,你唯一能看到的就是你输入的文字。像这样:

1 个答案:

答案 0 :(得分:0)

在你添加文本字段的部分,你可以设置它的属性。

alert.addTextField { (textField) in
      textField.placeholder     = "Bla sheep"
      textField.borderStyle     = .none   //remove borders
      textField.backgroundColor = .clear  //transparent background
}