- 是否有可能防止这种额外的拖动,这样这个白色区域就永远不会被看到?
是的。将图像放在UITableView
的背景上。不在单元格上。因为如果您将图像背景放在一个单元格上,并且当您水平交换要删除的单元格时,该单元格将移动。也就是说图像背景也会移动。但是如果你把它放在 上UITableView
,它就不会随着交换而移动。请记住将UITableView
和UITableViewCell
的背景颜色设置为清晰的颜色。
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ReuseIdentifier"];
UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"cellBackground.png"]];
imageView.frame = CGRectMake(0, kCellHeight*indexPath.row, 320, cell.frame.size.height);
[tableView addSubview:imageView];
[tableView sendSubviewToBack:imageView];
return cell;
}
2.另外,你知道为什么删除按钮下面有细白线吗?
我认为这是苹果的小错误。您也可以在天气应用程序中找到它。所以别介意。