您如何以编程方式选择Swift文本字段中的所有文本?
var textField:UITextField = UITextField()
textField.frame = CGRectMake(2, 25, 200, 20)
textField.text = "hello"
textField.font = UIFont(name: "Verdana", size: 12)
textField.textColor = UIColor.blackColor()
textField.backgroundColor = UIColor.whiteColor()
或者至少使文本立即可编辑?
谢谢
安德鲁
textField.becomeFirstResponder()
textField.selectAll(nil)
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句