相关疑难解决方法(0)

消除UITableView下面的额外分隔符

当我设置一个包含4行的表视图时,在填充的行下面还有额外的分隔符行(或额外的空白单元格).

我该如何移除这些细胞?

UITableView中额外分隔线的图像

cocoa-touch uitableview ios

690
推荐指数
16
解决办法
18万
查看次数

如果UITableViewCells为空,则隐藏删除分隔线

我有一个UITableView,我只有3行,我可以看到这3行.问题是空单元格:我可以在那里看到线条.我不想看到那些台词.

知道如何删除这些线?

下面是我正在寻找的图像.

图片链接

cocoa-touch uitableview ios

84
推荐指数
5
解决办法
6万
查看次数

UITableView显示的行数多于numberOfRowsInSection中指定的行数:

我希望我的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行的线条?

iphone objective-c uitableview ios

31
推荐指数
4
解决办法
1万
查看次数

标签 统计

ios ×3

uitableview ×3

cocoa-touch ×2

iphone ×1

objective-c ×1