Do I have to do this with code or is there something in the inspector that I'm missing?
Unlike UIButton
, a UITextField
does not have a highlighted state. If you want to change the color of the textfield when it receives focus, you can use the UITextFieldDelegate
's - (BOOL)textFieldShouldBeginEditing:(UITextField *)textField
This will be called when the control first receives focus. From there you can change the background and/or text color. Once focus leaves the control, you can use - (BOOL)textFieldShouldEndEditing:(UITextField *)textField
to reset the colors.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With