相关疑难解决方法(0)

iOS中的多行用户输入:UITextField与UITextView

我需要向用户显示一个多行文本输入"框",其高度大于a的标准高度UITextField.什么是最好或最正确的方法应该是什么?:

  1. 使用a UITextField并在代码中更改其高度或应用某个高度约束.
  2. 使用可编辑的UITextView.这是多行的,但默认情况下它没有占位符,我想我应该在代码中实现该功能.

multiline uitextfield uitextview ios swift

38
推荐指数
4
解决办法
5万
查看次数

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

我的提醒看起来像这样:

警报对话框的示例

是否有可能使输入更大并在它们之间增加空间?这是我的代码中的一个片段.我尝试更改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)

uitextfield ios swift ios8 uialertcontroller

5
推荐指数
1
解决办法
5022
查看次数