【发布时间】:2013-12-07 02:59:55
【问题描述】:
尝试以编程方式突出显示配置为“Shows Touches On Highlight”的 UIButton,发现以下代码无法正确设置动画(持续时间无效;突出显示只是闪烁):
button.highlighted = YES;
[UIView animateWithDuration:3.0
animations:^{ button.highlighted = NO; }
];
也尝试过,结果相似(只是一闪而过):
button.highlighted = YES;
[UIView animateWithDuration:3.0
animations:^{}
completion:^(BOOL finish){ button.highlighted = NO; }
];
以编程方式打开按钮突出显示并在一段时间后将其关闭的最佳方法是什么?
【问题讨论】:
标签: animation uibutton highlight