Is it possible to have a fixed uitableview Header while using sections?

后端 未结 4 1431
天涯浪人
天涯浪人 2020-12-05 09:38

This question should not be mixed up with this here.. These are two different things.

There is a good example how to use a UITableView Header on SO.

This all

4条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-05 10:16

    If you want a UITableViewController (static cells/keyboard handling) and have a fixed header then you should use Containment. You can do this from a Storyboard by setting up a UIViewController with your fixed header and then using a Container View to embed the UITableViewController.

    Once you have your containing view setup, you right-click drag from the Container View to the View Controller you want to embed - the UITableViewController in this case.

    You can access and get a reference to the contained View Controller (the UITableViewController) from the Container View Controller by implementing the prepareForSegue:sender: method.

提交回复
热议问题