我可以使XCode UITableViewCellEditingStyle不偏移吗



我正在Xcode 4.3.1中制作一个新的应用程序,我正在使用一个具有自定义外观的UITableView。基本上,我有一张图片,几乎占据了整个320个像素。因此,当我实现编辑(重新排列单元格)时,苹果会默认将所有内容向右推50像素左右。我希望永远不会有任何动静。只需在右侧显示小线条,就可以拖动单元格。我不允许删除或插入,所以我的样式总是设置为UITableViewCellEditingStyleNone,但在编辑模式下,这会在左侧留下一个小图标,但我希望左侧没有空间,只有右侧的行可以拖动。有什么想法吗?

这是一些示例代码:

// The editing style for a row is the kind of button displayed to the left of the cell when in editing mode.
- (UITableViewCellEditingStyle)tableView:(UITableView *)aTableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath {
    // No editing style if not editing or the index path is nil.
    if (self.editing == NO || !indexPath)
        return UITableViewCellEditingStyleNone;
    return UITableViewCellEditingStyleNone;
}

看看shouldIndentWhileEditing

最新更新