swift 隐藏多余的TableView

2020-05-26  本文已影响0人  Antlers777

//  消除 多余 cell

    override func tableView(_tableView:UITableView, viewForFooterInSection section:Int) ->UIView? {

        if(section == tableView.numberOfSections-1){

            return UIView.init(frame:CGRect(x:0, y:0,width:1, height:1))

        }

        return nil

    }

或者

tableView?.tableFooterView = .init()

上一篇 下一篇

猜你喜欢

热点阅读