系统的tableViewCell的左滑实现

本文介绍如何在iOS应用中实现UITableView的滑动编辑功能,包括设置滑动操作及自定义操作样式。

系统自带可以进行表格滑动效果的协议方法,只需要这一步!!

// 允许编辑
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath{
    return YES;
}
-(NSArray<UITableViewRowAction*>*)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath
{

    UITableViewRowAction *rowAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault
                                                                         title:@"跟进" handler:^(UITableViewRowAction *  action, NSIndexPath * indexPath) {
                                                                             NSLog(@"跟进");

                                                                         }];

    UITableViewRowAction *rowActionSec = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault
                                                                            title:@"快速备忘"    handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) {
                                                                                NSLog(@"快速备忘"); // 这里做你自己想要做的事情

                                                                            }];
    rowActionSec.backgroundColor = [UIColor yellowColor];

    NSArray *arr = @[rowAction,rowActionSec];
    return arr;
}

这里写图片描述

愿阳光充满每一天!!!!

让tabbar消失分割线

[self.tabBar setClipsToBounds:YES];

如果我们的高度是高于49的话,可以使用

if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 6)

{

[[UITabBar appearance] setShadowImage:[[UIImage alloc] init]];

}
这样那条黑线就会不见了。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值