textField.placeholder = @"username is in here!";
[textField setValue:[UIColor redColor] forKeyPath:@"_placeholderLabel.textColor"];
[textField setValue:[UIFont boldSystemFontOfSize:16] forKeyPath:@"_placeholderLabel.font"];
這裏是使用了KVC的方式
textField.placeholder = @"username is in here!";
[textField setValue:[UIColor redColor] forKeyPath:@"_placeholderLabel.textColor"];
[textField setValue:[UIFont boldSystemFontOfSize:16] forKeyPath:@"_placeholderLabel.font"];
方法一:使用歸檔:其實質就是讀寫文件操作,(歸檔,解檔:archive,unarchive) // 歸檔 + (NSData *)archivedDataWithRootObject:(id)
純代碼的情況下,可用: _tfUserName.clearButtonMode = UITextFieldViewModeWhileEdit