天天看點

textField設定placeholder的字型大小,顔色等

textField.placeholder = @"username is in here"; [textField setValue:[UIColor redColr] forKeyPath:@"_placeholderLabel.textColor"]; [textField setValue:[UIFont boldSystemFontOfSize:16] forKeyPath:@"_placeholderLabel.font"];

setValue: forKeyPath:    利用kvc的機制,設定placeholder的屬性

繼續閱讀