UIButton没有眨眼

Con*_*nor 2 objective-c uibutton ios

我有一个UIButton,在UIView内部以编程方式创建(层次结构中没有其他级别).该按钮确实可以touchUpInside正确响应事件,但由于某种原因,文本在触摸时没有表现出正常的"闪烁"行为.如果有人知道可能导致这种情况的原因,我想回复一下.

其他说明:我有,userInteractionEnabled = TRUE并且我的代码中没有自定义动画.相关的实例化代码(UIColor名称来自自定义类别):

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];
Run Code Online (Sandbox Code Playgroud)

mat*_*att 6

问题是,正常状态的自定义颜色也适用于突出显示的状态,除非您为突出显示的状态为其指定单独的颜色.所有与按钮状态相关的值都是如此.