滚动浏览屏幕后,UITableView不会反弹

esp*_*tia 11 objective-c uitableview ios

这是一个正在发生的事情的视频:https://imgflip.com/gif/kgvcq

基本上,如果单元格滚动超过屏幕的下边缘,它将不会反弹.我试着更新contentSize了的tableView似乎并不成为问题,但.我也确保宣布rowHeight并且仍然没有运气.最后,我确保正确设置bounce属性tableView.

嗨,大家好抱歉没有提供代码,这里是:

// data source
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    NSLog(@"frame height: %f", tableView.frame.size.height);
    NSLog(@"content size height: %f", tableView.contentSize.height);

    static NSString *CellIdentifier = @"HabitCell";

    HabitTableViewCell *cell = (HabitTableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    cell.viewController = self;
    cell.delegate = self;

    // edit cell

    return cell;
}
Run Code Online (Sandbox Code Playgroud)

NSLogs分别568和400:正在返回.是框架会导致问题吗?另外,我还没有覆盖scrollViewDidScroll.

实施数据源方法

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    // Return the number of rows in the section.
    return [self.habits count];
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    if ([indexPath isEqual:_expandIndexPath]) {
        return 450 + heightToAdd;
    }
    return 100;
}
Run Code Online (Sandbox Code Playgroud)

esp*_*tia 2

scrollToRowAtIndexPath已修复:我在我的方法中调用了UIPanGestureRecognizer。删除它,现在可以正常工作了。