zoukankan      html  css  js  c++  java
  • iOS开发小技巧--cell往左拖拽出现很多按钮的实现,仅仅适用于iOS8以后

     1 // 往左拖拽cell出现多个按钮的实现,仅仅适用于iOS_8.0以后
     2 - (NSArray<UITableViewRowAction *> *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath
     3 {
     4     UITableViewRowAction *action = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDestructive title:@"删除" handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) {
     5         NSLog(@"点击删除的时候调用");
     6     }];
     7     UITableViewRowAction *action2 = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"编辑" handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) {
     8         NSLog(@"点击编辑的时候调用");
     9     }];
    10     action2.backgroundColor = [UIColor grayColor];
    11     return @[action,action2];
    12 }
  • 相关阅读:
    正向代理和反向代理
    Unicode
    utf-8
    ISO 8895-1
    ProtocalBuffers学习记录
    C#基础知识
    MSBuild学习记录
    Linux学习笔记
    Jenkins学习记录
    CruiseControl.Net学习记录
  • 原文地址:https://www.cnblogs.com/gchlcc/p/5331179.html
Copyright © 2011-2022 走看看