美文网首页
TableView简单小技巧

TableView简单小技巧

作者: SunshineBrother | 来源:发表于2017-09-14 15:32 被阅读96次
    1、使用tableview的分界线,但是界面下面有一些没有数据但是还是显示了分界线
     //隐藏多余cell
        self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
    
    2、去掉navigationitem下面的阴影
    self.navigationController.navigationBar.shadowImage = [UIImage new];
    

    3、删除cell

    cell.discardClose = { currentCell in
                let currentIndexPath = self.tableView .indexPath(for: currentCell)!
                self.dataList.removeObject(at: currentIndexPath.row)
                self.tableView.beginUpdates()
                self.tableView.deleteRows(at: [currentIndexPath], with: .none)
                self.tableView.endUpdates()
                
            }
    

    相关文章

      网友评论

          本文标题:TableView简单小技巧

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