Computer >> Hướng Dẫn Máy Tính >  >> Lập Trình >> iOS

Thay đổi font và màu chữ UITextView trong iOS

Cập nhật thuộc tính textColor và font của UITextView.

@IBOutlet var textView: UITextView!

override func viewDidLoad() {
  super.viewDidLoad()
  textView.textColor = UIColor.cyan
  textView.font = UIFont(name: "Callout", size: 20)
}

Chạy app: UITextView hiển thị chữ màu cyan, font Callout size 20.