A chicken thief solutions for custom clearButton style, you can directly modify the background
1. Based UITextField's category and add the following methods and statement
- (void)setLightStyle:(BOOL)lightStyle {
UIButton *clearButton = [self valueForKey:@"_clearButton"];
[clearButton setImage:@"clearButton".image forState:0];
[clearButton setImage:@"clearButton".image forState:1];
}
Perform a global style replacement program started after 2. Appdelegate
[[UITextField appearance] setLightStyle:YES];
3. surprise!!