美文网首页
删除按钮侧滑

删除按钮侧滑

作者: 赤焰军少帅林殊 | 来源:发表于2019-10-09 17:53 被阅读0次
  • (void)tableView:(UITableView *)tableView willBeginEditingRowAtIndexPath:(NSIndexPath *)indexPath {

    if (@available(iOS 11.0, *)) {

          for (UIView *swipeActionPullView in self.tableView.subviews)
          {
              if([swipeActionPullView isKindOfClass:NSClassFromString(@"UISwipeActionPullView")]){
                  for (UIView *swipeActionStandardButton in swipeActionPullView.subviews) {
                      if ([swipeActionStandardButton isKindOfClass:NSClassFromString(@"UISwipeActionStandardButton")]) {
                          
                          for (UIImageView *imageView in swipeActionStandardButton.subviews) {
                              if ([imageView isKindOfClass:[UIImageView class]]) {
                                  if ([imageView viewWithTag:k_ash_action_img]==nil) {
                                      UIImageView *addedImageView = [[UIImageView alloc] initWithFrame:imageView.bounds];
                                      addedImageView.tag = k_ash_action_img;
                                      addedImageView.image= [imageView.image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
                                      [imageView addSubview:addedImageView];
                                  }
                                  break;
                              }
                          }
                      }
                  }
              }
          }
    

    }
    }

相关文章

网友评论

      本文标题:删除按钮侧滑

      本文链接:https://www.haomeiwen.com/subject/unggpctx.html