How do I add an UIView above a TableViewController

后端 未结 2 1790
暗喜
暗喜 2021-01-19 16:44

I would like to display an UIView above my tableview, for testing purposes I have used a Searchbar (to eliminate any possible problems with my code).

My setup:

2条回答
  •  悲哀的现实
    2021-01-19 16:57

    If you're MyCustomTableViewController is actually a UITableViewController then you'll notice in IB that the "view" outlet points directly to your UITableView instead of the root UIView in IB. This is the default behavior for UITableViewController objects. Simply redirect the "view" outlet to the root UIView and everything should display correctly.

提交回复
热议问题