iOS UITableViewCell上 撤消button点击延迟

iOS UITableViewCell上 取消button点击延迟

这个现象在高亮状态时最为明显 连续触碰button 高亮状态会不显示。 处理方案是关掉scrollView的延迟

代码: 

      在创建tableView的地方加下面这行

  _tableView.delaysContentTouches =NO;

      
     在tableView代理方法 cellForRow 里加入下面代码
     

 for (UIView *currentViewin cell.subviews)

    {

       if([currentView isKindOfClass:[UIScrollViewclass]])

        {

            ((UIScrollView *)currentView).delaysContentTouches =false;

           break;

        }

    }

     这段代码解决的条件是iOS7。  如果是iOS环境下代码为
    

 for (UIView *currentViewin _tableView.subviews)

    {

       if([currentView isKindOfClass:[UIScrollViewclass]])

        {

            ((UIScrollView *)currentView).delaysContentTouches =false;

           break;

        }

    }