我需要向用户显示一个多行文本输入"框",其高度大于a的标准高度UITextField.什么是最好或最正确的方法应该是什么?:
UITextField并在代码中更改其高度或应用某个高度约束.UITextView.这是多行的,但默认情况下它没有占位符,我想我应该在代码中实现该功能.我的提醒看起来像这样:
是否有可能使输入更大并在它们之间增加空间?这是我的代码中的一个片段.我尝试更改frame第二个文本字段的属性,但它没有帮助:
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
})
Run Code Online (Sandbox Code Playgroud)