1

which editingStyle i have to use to have the result of this tutorial?

Table View Programming

I would like have a editingStyle without "-" or "+". If in the method editingStyleForRowAtIndexPath i return UITableViewCellEditingStyleNone i don't have "-" (for delete) or "+" (for insert) but i have my table's rows shifted to right e with blank space.

In the apple's tutorial there is not the blank space before of the rows's content.

What is the way to resolve this issue?

Thanks in advance

4

2 回答 2

1

为了解决我的问题,我实现了这个UITableViewDelegate方法

-(BOOL)tableView:(UITableView*)tableView shouldIndentWhileEditingRowAtIndexPath:(NSIndexPath*)indexPath;

对于我桌子的每一行returns NO;

谢谢大家。

于 2013-10-30T14:49:08.280 回答
1

NO如果您不希望该行可编辑并且您不希望该行在表格视图处于编辑模式时缩进,则通过从tableView:canEditRowAtIndexPath:数据源方法返回来指示该行不能被编辑。当然,您需要返回YES可以编辑NO的索引路径,但返回不能编辑的索引路径。

- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
    if (/* this index path can be edited */) {
        return YES;
    } else {
        return NO;
    }
}
于 2013-10-28T14:29:41.080 回答