2
的UITextField佔位設置字體我用下面的代碼爲UITextField的文本(16)和佔位符(9)設定不同的字體,用於迅速
m_searchTextField.font = UIFont .systemFontOfSize(16)
let font = UIFont .systemFontOfSize(9)
let attributes = [
NSForegroundColorAttributeName: UIColor.lightGrayColor(),
NSFontAttributeName : font]
m_searchTextField.attributedPlaceholder = NSAttributedString(string: "Search String be in meddle left",
attributes:attributes)
字體大小設置正確,但佔位符文本集在文本字段中稍高一些。
我怎樣才能解決這個問題?有什麼建議麼?
http://stackoverflow.com/questions/27652227/text-view-placeholder-swift/28271069#28271069 – clearlight