Combine static and prototype content in a table view

前端 未结 8 1052
遇见更好的自我
遇见更好的自我 2020-11-28 23:57

Is there a way to combine static tableview cells (static content) with dynamic tableview cells (prototype content) using storyboard?

8条回答
  •  佛祖请我去吃肉
    2020-11-29 00:25

    You can't have one tableview be static and the other dynamic in the same view controller so you will need to make them both dynamic. In the first tableview you will configure the cells in code on initializing the view controller never update them.

    1. Add a UIViewController to your storyboard.
    2. Add two Table Views (Not TableViewControllers) to the UIView Controller.
    3. Select each tableView and configure both for dynamic cells.
    4. Build and attach your view controller. 2 tableview on a single view explains that step.

    As another option you can achieve a similar look by embedding your dynamic tableview in part of a view similar to the link in step 4 and then do whatever you wanted to in the rest of the view to setup what you were planning to do with static cells by using scrollviews, labels, and buttons.

提交回复
热议问题