ABMenuTableViewCell 2.0.2

ABMenuTableViewCell 2.0.2

测试已测试
Lang语言 Obj-CObjective C
许可证 MIT
发布最新发布2017年12月

Alex Bumbu 维护。



  • Alex Bumbu

完全兼容 iOS 9

这是一个高度可定制且易于使用的解决方案,可以用于 UITableViewCell 的右侧菜单,通过“向左滑动以删除”的手势显示。

邮件应用风格的菜单 - 显示 & 隐藏示例

无需任何额外工作,只需通过默认的向左滑动以删除的手势即可显示右侧菜单视图。隐藏菜单也使用像点击或向左滑动一样的已知手势。

Screenshot

邮件应用风格的菜单 - 删除项目示例

删除行与默认实现一样简单。

Screenshot

自定义样式菜单 - 显示、隐藏 & 删除示例

使用自定义菜单位置的优势在于您可以避免陷入苹果风格的按钮,并且可以轻松地集成您自己的设计。

Screenshot

整合

  • 通过 cocoapods 安装(只需将 pod 'ABMenuTableViewCell', '~> 2.0' 添加到您的 Podfile),或者克隆此仓库并将 ABMenuTableViewCell 文件夹的内容拖动到您的项目中。
  • 要使用,只需将 UITableViewCell 替换为 ABMenuTableViewCell,并将您的自定义菜单视图分配给 rightMenuView 属性,就可以了!您可以通过以下片段了解详细信息。
- (UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *identifier = @"ABMenuTableViewCell";
    ABMenuTableViewCell *cell = (ABMenuTableViewCell*)[tableView cellForRowAtIndexPath:indexPath];

    if (!cell) {
        cell = [[ABMenuTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier];
    }

    // use your own custom menu view
    UIView *menuView = [[UIView alloc] initWithFrame:CGRectMake(.0, .0, 160.0, 44.0)];
    menuView.backgroundColor = [UIColor redColor];

    cell.rightMenuView = menuView;
    cell.textLabel.text = @"Lorem ipsum dolor sit amet";

    return cell;
}

兼容性

  • iOS 7.x 或更高版本

致谢

ABMenuTableViewCell 由 Alex Bumbu 创建。

许可证

ABMenuTableViewCell 在 MIT 许可证下可用。有关更多信息,请参阅 LICENSE 文件。如需无版权信息的使用,请联系 Alex Bumbu