manually add UITabBar to UITableViewController

淺唱寂寞╮ 提交于 2019-12-04 16:50:15

So, the problem with a UITableViewController is it doesn't quite work as you might expect. It's very difficult to add 'locked' elements to a UITableView - the table footers and headers don't do the job, and as you've discovered adding it to the superview doesn't work.

The best solution in this case is actually to throw the table view controller out the window, and use a table view with a normal view controller.

What you want to do is create a normal UIViewController, and then add a table view to it. Your table view delegate and datasource can also be in this view controller.

You can then resize your table view to be smaller than the size of the screen, and add your UITabBar to the view controller's main view.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!