Swift - UIAlertcontroller 中文本字段的大小

Swift - size of textfield on UIAlertcontrller

我想增加 UIAlertController 上 UITextField 的初始高度。 这是我的代码:

let reportAlertController = UIAlertController(title: "Report", message: "If you find anything to report, please write it in the text box below and press send. To cancel report, press cancel.", preferredStyle: .Alert)
reportAlertController.addTextFieldWithConfigurationHandler({ (tf) -> Void in
  tf.frame.size.height = 1500
  tf.placeholder = "Report detail(s) here"
})


reportAlertController.addAction(UIAlertAction(title: "Send", style: UIAlertActionStyle.Default, handler: nil))
reportAlertController.addAction(UIAlertAction(title: "Cancel", style: UIAlertActionStyle.Default, handler: nil))
presentViewController(reportAlertController, animated: true, completion: nil)

问题是,即使我重新分配框架大小,它也不会反映在警报中。任何帮助将不胜感激。

已编辑: 或者我想知道当它到达宽度的末端时扩展高度的方法。

尝试:

    let reportAlertController = UIAlertController(title: "Report", message: "If you find anything to report, please write it in the text box below and press send. To cancel report, press cancel.", preferredStyle: .Alert)
reportAlertController.addTextFieldWithConfigurationHandler({ (tf) -> Void in
  tf.frame.size.height = 1500
  tf.placeholder = "Report detail(s) here"
})


reportAlertController.addAction(UIAlertAction(title: "Send", style: UIAlertActionStyle.Default, handler: nil))
reportAlertController.addAction(UIAlertAction(title: "Cancel", style: UIAlertActionStyle.Default, handler: nil))
presentViewController(reportAlertController, animated: true, completion: nil)

reportAlertController.addAction(UIAlertAction(title: "Send", style: UIAlertActionStyle.Default, handler: nil))
reportAlertController.addAction(UIAlertAction(title: "Cancel", style: UIAlertActionStyle.Default, handler: nil))
presentViewController(reportAlertController, animated: true, completion: { () -> Void in
           self.layoutIfNeeded() //Update frame
        })