UITableView不会滚动

所以,这是我的看法:

在此处输入图像描述

这是我的UItableViewDelegate和DataSource

-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; } -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return 20; } -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"course"]; cell.textLabel.text = [NSString stringWithFormat:@"%i" ,arc4random() % 10]; cell.detailTextLabel.text = [NSString stringWithFormat:@"%i" ,arc4random() % 10]; return cell; } 

这就是结果:

在此处输入图像描述

问题是UItableView不滚动。 决不。 我真的无法弄清楚为什么……有人可以帮帮我吗?

我见过类似的事情,每次我看到这种行为都是因为有些观点正在捕捉触摸。

在clear中,检查视图Hierarchy以查看视图是否与tableView重叠(即使alpha为0.05的视图也可以识别和消化触摸)。

我建议你采取控制器的根视图,并递归调用视图Hierarchy to NSLog图像的大小。

您也可以使用tableView执行此操作:

 - (void)bringSubviewToFront:(UIView *)view [self.view bringSubviewToFront:self.tableView]; 

如果你的桌面视图在其他所有内容前面滚动,你会知道某些视图在表视图之前捕获了触摸。

试着说self.tableView.userInteractionEnabled = YES; 实现时钟视图后。

如果这不起作用,请尝试[self.view bringSubviewToFront:self.tableView];

我试图获得类似的结果,它对我来说很好。 尝试检查您的选项

UITableViewOptions