美文网首页学Swift挣美金swift
Swift代码库之searchbar固定不随tableview滚

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

作者: iCloudEnd | 来源:发表于2019-06-23 19:41 被阅读2次

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
    }

相关文章

网友评论

    本文标题:Swift代码库之searchbar固定不随tableview滚

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