【问题标题】:Can i make the XCode UITableViewCellEditingStyle NOT offset?我可以让 XCode UITableViewCellEditingStyle 不偏移吗?
【发布时间】:2012-03-29 23:59:13
【问题描述】:

我正在 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;
}

【问题讨论】:

    标签: iphone xcode uitableview cell


    【解决方案1】:

    【讨论】:

    • 太棒了。有时苹果是如此明显,有时又如此神秘。在这种情况下,很明显,如果你知道在哪里看。谢谢你。感叹号也有帮助。 ;)
    猜你喜欢
    • 2019-09-13
    • 2023-03-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-09-13
    • 2011-08-17
    相关资源
    最近更新 更多