UITextView
2019-08-04 本文已影响0人
CaptainRoy
override func viewDidLoad() {
super.viewDidLoad()
let textTextView = UITextView(frame: CGRect(x: 20.0, y: 60.0, width: 200.0, height: 100.0))
textTextView.layer.borderWidth = 1.0
textTextView.layer.borderColor = UIColor.gray.cgColor
self.view.addSubview(textTextView)
textTextView.isEditable = false
textTextView.text = "第一行\n电话:15811227327\n邮箱:email@icloud.com www.baidu.com"
textTextView.dataDetectorTypes = .all // 电话 网址等
}