代码之家  ›  专栏  ›  技术社区  ›  DNB5brims

如何避免使用触摸uiTableView?

  •  0
  • DNB5brims  · 技术社区  · 16 年前

    我希望用户滚动uitableview,但不点击uitableview,我该怎么做?谢谢您。

    2 回复  |  直到 15 年前
        1
  •  0
  •   BoltClock    16 年前

    使用

    - (void)scrollToRowAtIndexPath:(NSIndexPath *)indexPath atScrollPosition:(UITableViewScrollPosition)scrollPosition animated:(BOOL)animated
    {
    
    }
    
        2
  •  0
  •   ferdil    15 年前

    您需要对委托函数进行编码

    - (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath {
        if (YouWantToAllowTouch)
            return indexPath;
        else
            return nil;
    

    }