UITableViewCell就像iphone上的邮件一样

时间:2014-05-06 01:34:07

标签: objective-c ios7 uitableview

如何调整UITableViewCell以便在向左滑动后显示两个字段 - 与邮件客户端的操作方式相同? 现在我只看到“删除”按钮。 我想在那里也包含“更多”字段......

此外,对于第一个if子句Cell我没有得到“插入”字段。

- (UITableViewCellEditingStyle)tableView:(UITableView *)aTableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath {

    if(indexPath.row == self.reports.count){
        return UITableViewCellEditingStyleInsert;
    } else {
        return UITableViewCellEditingStyleDelete;
    }
}

有没有办法将字段与|组合运营商还是什么? 谢谢,EL-

1 个答案:

答案 0 :(得分:0)

您可以在iOS7中为 UITableView 使用未记录的委托方法

- (NSString *)tableView:(UITableView *)tableView titleForSwipeAccessoryButtonForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return @"More";
}

- (void)tableView:(UITableView *)tableView swipeAccessoryButtonPushedForRowAtIndexPath:(NSIndexPath *)indexPath
{
    [self setEditing:NO animated:YES];
}

它们似乎不是私密的,可以提交给appStore。