UIAlertController-更改文本字段的大小并在它们之间添加空间

问题描述:

我的警报如下:

是否可以增大输入并在它们之间增加空间?这是我的代码片段.我尝试更改第二个文本字段的frame属性,但没有帮助:

Is it possible to make inputs bigger and add space between them? Here is a snippet from my code. I tried changing the frame property of the second text field but it didn't help:

let alert = UIAlertController(title: title, message: message, preferredStyle: .Alert)

// Add the textfields
alert.addTextFieldWithConfigurationHandler({ (textField) -> Void in
  textField.placeholder = "Vaše jméno"

})

alert.addTextFieldWithConfigurationHandler({ (textField) -> Void in
  textField.placeholder = "Společné heslo"

  var oldFrame = textField.frame
  oldFrame.origin.y = 40
  oldFrame.size.height = 60
  textField.frame = oldFrame
})

UIAlertController视图旨在简单且不可自定义.如果您自己创建呈现的视图控制器,则该视图属于您,您可以做任何喜欢的事情.

UIAlertController views are intended to be simple and not customizable. If you make your own presented view controller, then the view belongs to you and you can do anything you like.