创建带灰字的文本输入框的方法

2016-04-06  本文已影响25人  lbhw
import UIKit  
  
class ViewController: UIViewController {  
    let textField = UITextField()  
  
    override func viewDidLoad() {  
        super.viewDidLoad()  
        textField.frame = CGRectMake(20, 20, 100, 50)  
        textField.textColor = UIColor.blueColor()  
        textField.placeholder = "Input:"  
        self.view.addSubview(textField)  
    }  
}  
上一篇 下一篇

猜你喜欢

热点阅读