UITableView and a UITextField that is always visible

为君一笑 提交于 2019-12-09 04:26:30

Don't use UITableViewController. After all, it's just a standard controller with a full-screen UITableView. You can roll your own easily.

Use a standard UIViewController and have it implement UITableViewDelegate and UITableViewDataSource protocols (you don't need to implement every method -- just the required ones). Then give it a UITableView as an iVar and set the delegate and dataSource to self. Size it so it only takes half the screen and your other views take the other part. You can lay out the whole thing in IB or create and position view+table manually.

I would suggest sticking a regular view in between your controller and your smaller "half-views". That has usually cleared things up for me, or at least exposed what the problem might be.

If you don't need functionality that UITableViewController provided, than you can just use UIViewController with <UITableViewDataSource, UITableViewDelegate> protocols. So, your main viewController will accept any type of views.

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