不久前I asked about how to move reorderControl View 靠近我的自定义单元格的中心,因此此 reorderControl 破坏了自定义设计。因为我不能移动这个 View 和我的单元格总是处于编辑模式 - 我只是在我的单元格背景的正确位置绘制这个 reorderControl。但现在我有两个 reorderControls ) 一个来 self 的背景,在正确的位置,一个来自 iOS。如果我将 - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
的返回值设置为 NO,iOS reorderControl 消失但我无法再对行进行重新排序。
如何从屏幕上删除 iOS reorderControl 并仍然能够重新排序我的自定义 UITableViewCell?
ps cell.showsReorderControl=NO;不工作
最佳答案
这有点像 hack,但下面确实有效
for(UIView* view in self.subviews)
{
if([[[view class] description] isEqualToString:@"UITableViewCellReorderControl"])
{
for(UIImageView* cellGrip in view.subviews)
{
if([cellGrip isKindOfClass:[UIImageView class]])
[cellGrip setImage:nil];
}
}
}
关于iphone - 如何在仍然使用重新排序的同时摆脱 reorderControl?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6897195/