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

问题描述:

我的提醒如下:

是否可以使输入更大并在它们之间增加空间?这是我的代码示例。我试图更改第二个textField的frame属性,但它没有帮助:

Is it possible to make inputs bigger and add space between them? Here is example of my code. I tried to change frame property of second textField 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.