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 }
  • 相关阅读:
    MySQL索引底层数据结构
    numpy和matplotlib读书笔记
    Python turtle学习笔记 #11933
    turtle笔记
    五角星绘制
    六角形绘制
    叠加等边三角形绘制
    什么叫方法签名
    Java编程思想 第七章
    类加载机制
  • 原文地址:https://www.cnblogs.com/gchlcc/p/5331179.html
Copyright © 2011-2022 走看看