UIAlertController - resizing text fields and adding space between them

My warning is as follows:

Alert Dialog Example

Is it possible to increase the number of inputs and add space between them? Here is an example of my code. I tried to change the border property of the second text box, but that 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
})
+4
source share
1 answer

UIAlertController views must be simple and not customizable. If you create your own presented view controller, then your view is yours and you can do whatever you like.

+10
source

Source: https://habr.com/ru/post/1616413/


All Articles