Ios7 UIButton';s uicontrol状态高亮显示,仅适用于较长的点击

Ios7 UIButton';s uicontrol状态高亮显示,仅适用于较长的点击,ios7,Ios7,我为我的UIButton设置了标题颜色和背景图像,如果我再按一下UIButton,它就会工作。但对于非常快速的点击,变化是不可见的。有没有可能至少让flickr应用于这些类型的水龙头 [button setTitleColor:[UIColor redColor] forState:UIControlStateNormal]; [button setTitleColor:[UIColor whiteColor] forState:UIControlStateSelected];

我为我的UIButton设置了标题颜色和背景图像,如果我再按一下UIButton,它就会工作。但对于非常快速的点击,变化是不可见的。有没有可能至少让flickr应用于这些类型的水龙头

    [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];

这是因为您向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;

这是一个很好的问题!我已经面对这个问题很久了,似乎找不到解决办法。你找到解决办法了吗?谢谢你提出这个问题,我也面临同样的问题。如果它对你有帮助,你应该考虑接受正确的答案。你是一个救生员!谢谢你善良的先生,这成功了!注意:这也适用于collectionView,简单的“self.collectionView.delaysContentTouches=NO”就足够了。