gpt4 book ai didi

ios - 覆盖-tableView :commitEditingStyle:forRowAtIndexPath: to display info

转载 作者:行者123 更新时间:2023-11-29 12:23:57 25 4
gpt4 key购买 nike

我想在我的 UITableViewCell 中显示信息。我希望能够在单元格上向左滑动,而不是显示 deleteCellButton 我想看到一段内容。我该如何重写此方法才能做到这一点。

- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{

}

我们将不胜感激

最佳答案

你可以使用下面的委托(delegate)方法

-(NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath {
return @"Some Content";
}

//普通委托(delegate)方法

- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
{
// Determine if it's in editing mode
if (self.tableView.editing)
{
return UITableViewCellEditingStyleDelete;
}

return UITableViewCellEditingStyleNone;
}

希望对你有帮助...!

关于ios - 覆盖-tableView :commitEditingStyle:forRowAtIndexPath: to display info,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29823090/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com