I have a UIButton, created programmatically, inside a UIView (no other levels to the hierarchy). The button does respond to the touchUpInside
event properly, but, for some reason, the text isn't exhibiting its normal "blink" behavior when touched. I'd like to get that back, if anyone knows what could cause this.
Other notes: I have userInteractionEnabled = TRUE
and there are no custom animations in my code. Relevant instantiation code (UIColor names are from a custom category):
self.loginButton = [[UIButton alloc] init];
self.loginButton.backgroundColor = [UIColor MPBlackColor];
[self.loginButton setTitle:@"LOG IN" forState:UIControlStateNormal];
[self.loginButton setTitleColor:[UIColor MPGreenColor] forState:UIControlStateNormal];
self.loginButton.titleLabel.font = [UIFont fontWithName:@"Oswald-Bold" size:24.0f];
The problem is that your custom color for the normal state applies also for the highlighted state, unless you give it a separate color for the highlighted state. This is true of all button state related values.
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