【问题标题】:UITableView respond when user taps the plus button to insert row当用户点击加号按钮插入行时 UITableView 响应
【发布时间】:2011-07-11 22:55:55
【问题描述】:

当用户在我的 UITableView 中点击“添加新行”绿色加号按钮时,我使用什么方法知道?

【问题讨论】:

  • 你有没有在按下按钮时被调用的函数?

标签: iphone ios ipad uitableview


【解决方案1】:

请参阅Table View Programming Guide 的“插入和删除行和节”部分

【讨论】:

    【解决方案2】:
    - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
        if (editingStyle == UITableViewCellEditingStyleInsert) {
        //your code here
        NSLog(@"user tapped insertion control");
        }   
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-09-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多