学Swift挣美金swift

Swift代码库之searchbar固定不随tableview滚

2019-06-23  本文已影响2人  iCloudEnd

Swift代码库之searchbar固定不随tableview滚动

  1. 定义设置界面函数
 func alertLayout(){
        tableView.tableHeaderView=UIView()
        tableView.estimatedSectionHeaderHeight = 50
    }
    
  1. 配置tableview
  func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
        return UITableView.automaticDimension
    }
    func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
        return wordSearchBar
    }
上一篇 下一篇

猜你喜欢

热点阅读