<分区>
var welcomeText: UITextField = {
let textField = UITextField()
textField.layer.cornerRadius = 25
textField.text = "Hello, are you \n Im doing good! 🙃"
textField.textColor = .white
return textField
}()
我想不通。任何帮助将不胜感激!
标签 ios swift uitextfield
<分区>
var welcomeText: UITextField = {
let textField = UITextField()
textField.layer.cornerRadius = 25
textField.text = "Hello, are you \n Im doing good! 🙃"
textField.textColor = .white
return textField
}()
我想不通。任何帮助将不胜感激!
最佳答案
UITextField
只能显示一行。如果您想要多行可编辑文本,则必须改用 UITextView
。
关于ios - Swift 4 -\n 不工作。我怎样才能把它转到另一条线。,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50126660/
相关文章:
ios - 以编程方式为我的 NavigationBar 创建了一个标题,但是没有出现在正确的位置?
ios - becomeFirstResponder() 不起作用
iphone - 从 customcell 转到 viewController
ios - 未知类型名称 'FIRDatabaseReference'
ios - Disclosure Indicator 不调用 seque 而 Detail Disclosure 调用
swift - 协议(protocol)字典 Swift 4
ios - UIButton 如何同时监听对其他按钮的更改、对 UILabel 文本的更改以及对 UITextView 的更改