【发布时间】:2012-01-11 19:35:57
【问题描述】:
我使用 IB 在 Xcode 4 中创建了一个UITableViewCell。但是由于某些奇怪的原因,当我触发我的编辑按钮时,cell 的行为非常奇怪,并且没有与普通表格视图单元格相同的动画。我不知道发生了什么,我尝试在我的自定义单元类中实现-(void)setEditing:(BOOL)editing animated:(BOOL)animated,但仍然没有任何效果。
更新:我正在使用单元格的ViewController,在cellForAtIndex 下有此代码来显示单元格。
CustomCell *cell = (CustomCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if(cell == nil)
{
NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"CustomCell" owner:nil options:nil];
for (id currentObject in topLevelObjects)
{
if ([currentObject isKindOfClass:[UITableViewCell class]])
{
cell = (CustomCell *) currentObject;
break;
}
return cell;
}
}
普通视图:
点击编辑按钮时:
即使在应该将文本移到一边时滑动它也会覆盖文本:
【问题讨论】:
标签: iphone uitableview interface-builder editing