Swift UIKit 组件-UITextField(文本输入框)
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let MyTextField = UITextField()
MyTextField.frame = CGRect(x: 135, y: 50, width: 160, height: 35)
MyTextField.borderStyle = .roundedRect
view.addSubview(MyTextField)
// Do any additional setup after loading the view.
}
}