【发布时间】:2015-07-26 21:01:53
【问题描述】:
我有一个以编程方式创建的 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];
【问题讨论】:
-
为突出显示的状态赋予标题颜色。
-
我以前从来没有这样做过,除非我在颜色选择上进行一些试验和错误,否则效果似乎不一样......这种行为最近有变化吗?编辑:当我将按钮放到空白故事板上时,它仍然会像我习惯的那样闪烁
-
就像我说的,它的效果不太一样,但它会起作用。谢谢
标签: ios objective-c uibutton