原理是通過KVC來實(shí)現(xiàn)
//獲取searchBar里面的TextField
UITextField*searchField = [_searchBar valueForKey:@"_searchField"];
//更改searchBar 中PlaceHolder 字體顏色
[searchField setValue:[UIColor blackColor] forKeyPath:@"_placeholderLabel.textColor"];
//更改searchBar輸入文字顏色
searchField.textColor= [UIColor blackColor];