我为我的UIButton设置了titleColor和backgroundImage,如果我按下UIButton稍微长一点就行。但是对于非常快速的水龙头,这种变化是不可见的。是否有可能至少让它为这些类型的水龙头闪烁?
[button setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
[button setTitleColor:[UIColor whiteColor] forState:UIControlStateSelected];
[button setTitleColor:[UIColor whiteColor] forState:UIControlStateHighlighted];
[button setBackgroundImage:whiteBackgroundImage forState:UIControlStateNormal];
[button setBackgroundImage:redBackgroundImage forState:UIControlStateSelected];
[button setBackgroundImage:redBackgroundImage forState:UIControlStateHighlighted];
答案 0 :(得分:2)
这是因为您向UITableView或UIScrollVIew添加了一个按钮。
对于UITableView中的按钮,将其添加到ViewDidLoad:
self.tableView.delaysContentTouches = NO;
for (id obj in self.tableView.subviews)
{
if ([obj respondsToSelector:@selector(setDelaysContentTouches:)])
{
[obj setDelaysContentTouches:NO];
}
}
对于UIScrollView中的按钮,请添加:
self.scrollView.delaysContentTouches = NO;