can I change the color of the clearButtonMode on a textField?
theTextField.clearButtonMode = UITextFieldViewModeWhileEditing
shows an x tha
A cleaner way is to implement a category on UITextField with this method:
- (void)modifyClearButtonWithImage:(UIImage *)image {
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
[button setImage:image forState:UIControlStateNormal];
[button setFrame:CGRectMake(0.0f, 0.0f, 15.0f, 15.0f)];
[button addTarget:self action:@selector(clear:) forControlEvents:UIControlEventTouchUpInside];
self.rightView = button;
self.rightViewMode = UITextFieldViewModeWhileEditing;
}
-(IBAction)clear:(id)sender{
self.text = @"";
}