【问题标题】:UITableViewRowAction buttons appearance in a single columnUITableViewRowAction 按钮在单列中的外观
【发布时间】:2015-05-06 17:36:51
【问题描述】:

您好,我正在使用行高更大的表格视图,我需要在滑动单元格时使用两个按钮编辑和删除。我使用以下代码获得了这两个按钮:-

  -(NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewRowAction *button = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"Delete" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath)
                                    {
                                       // Logic
                                    }];
    button.backgroundColor = [UIColor redColor]; //arbitrary color
    UITableViewRowAction *button2 = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleNormal title:@" Edit " handler:^(UITableViewRowAction *action, NSIndexPath *indexPath)
                                     {
                    // Logic
                                     }];
    button2.backgroundColor = [UIColor lightGrayColor];
    return @[button, button2];
}

这两个按钮出现在两列中,我需要它们在两行的单列中。我已经看到几乎所有表格单元格都具有这种结构(多列)。请帮帮我

【问题讨论】:

    标签: objective-c uitableview uitableviewrowaction


    【解决方案1】:

    GitHub 上有一个名为 https://github.com/srikanth-vm/GSSwipeableCell 的开源项目,它实现了该功能。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-10-28
      • 1970-01-01
      • 2021-09-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-05-14
      相关资源
      最近更新 更多