Home > Blockchain >  Swift How to remove UITableView header that appears on scroll?
Swift How to remove UITableView header that appears on scroll?

Time:01-12

When I scroll on my UITableView, an empty header appears at the top of the view that prevents the user to see some information properly as you can see in the following screenshot:

enter image description here

How can I remove this?

CodePudding user response:

It is actually a UINavigationBar that you're seeing. Try this in your UIViewController to hide the navigation bar:

override func viewWillAppear(_ animated: Bool) {
    super.viewWillAppear(animated)
    navigationController?.setNavigationBarHidden(true, animated: animated)
}

If the navigation bar is used in previous view controllers in your navigation stack, make sure to make it visible there again.

  •  Tags:  
  • Related