change the color of a UITextField clearButton:
CGFloat myWidth = 25.0f;
CGFloat myHeight = 25.0f;
UIButton *myButton = [[UIButton alloc] initWithFrame:CGRectMake(0.0f, 0.0f, myWidth, myHeight)];
[myButton setImage:[UIImage imageNamed:@"close"] forState:UIControlStateNormal];
[myButton setImage:[UIImage imageNamed:@"close"] forState:UIControlStateHighlighted];
[myButton addTarget:self action:@selector(doClear:) forControlEvents:UIControlEventTouchUpInside];
myTextField.rightView = myButton;
myTextField.rightViewMode = UITextFieldViewModeUnlessEditing;
No comments:
Post a Comment