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