我有一个UITableView,我只有3行,我可以看到这3行.问题是空单元格:我可以在那里看到线条.我不想看到那些台词.
知道如何删除这些线?
下面是我正在寻找的图像.

我希望我的tableView显示6行,其中包含文本,在本例中为"Example".至于我可以告诉大家,我有我的numberOfSectionsInTableView:和numberOfRowsInSection:正确设置.请参阅以下示例代码:
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
// Return the number of sections.
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
// Return the number of rows in the section.
return 6;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
cell.textLabel.text = @"Example";
return cell;
}
Run Code Online (Sandbox Code Playgroud)
问题是当您看到下面的图像显示不应该/不存在的行的行时.

如何摆脱显示过去第6行的线条?