How to embed a UITableView in a UIScrollview

后端 未结 6 648
借酒劲吻你
借酒劲吻你 2020-12-05 05:47

How can I do the following in a UIViewController (containing a tableview as a subview)

I initially have a UIViewController showing a preview section (UIView)

6条回答
  •  情话喂你
    2020-12-05 06:13

    No need for anything fancy or custom, use a UITableView and set your preview pane to be the tableHeaderView and your search field to be the section header using tableView:viewForHeaderInSection: in your UITableViewDelegate.

    The table header will scroll off the top during scroll event. Section headers float and stay visible the whole time that section if visible. If you only have 1 section, then the section header will be there the whole time.

提交回复
热议问题