TextFiled 修改clearButton 图片按钮, 非rightView

1
2
3
4
5
6
7
8
9
10
11
UIButton *clearButton = [_textField valueForKey:@"_clearButton"];
if (clearButton && [clearButton isKindOfClass:[UIButton class]]) {

if ([DKNightVersionManager currentThemeVersion] == DKThemeVersionNormal) {
[clearButton setImage:[UIImage imageNamed:@"Search-Topba-Close"] forState:UIControlStateNormal];
[clearButton setImage:[UIImage imageNamed:@"Search-Topba-Close-Night"] forState:UIControlStateHighlighted];
}else {
[clearButton setImage:[UIImage imageNamed:@"Search-Topba-Close-Night"] forState:UIControlStateNormal];
[clearButton setImage:[UIImage imageNamed:@"Search-Topba-Close-Highted-Night"] forState:UIControlStateHighlighted];
}
}