Search bar jumps down one row every time cancel button is tapped

后端 未结 3 926
伪装坚强ぢ
伪装坚强ぢ 2021-01-05 06:25

I have implemented a UISearchBar to search through a catalogue of items from an external API. The Search functionality works as expected, however the problem is that every t

3条回答
  •  孤独总比滥情好
    2021-01-05 06:34

    I've made an open source project SearchTableView

    self.searchController.searchBar.sizeToFit()
    self.tableHeaderView = self.searchController.searchBar
    
    searchTableView.layoutMargins = UIEdgeInsets.zero
    definesPresentationContext = true
    extendedLayoutIncludesOpaqueBars = true
    

提交回复
热议问题