Need approach to show tables using segmented control?

后端 未结 2 458
走了就别回头了
走了就别回头了 2020-12-07 23:53

Hi there I using a segmented control on a view. With the help of this segmented control I would like to display to different tables on my view, Suppose I have two segments i

2条回答
  •  伪装坚强ぢ
    2020-12-08 00:23

    Another alternative is to have a container view, which you add whichever tableView is current as a subview. You can even have each table be in a different view controller to keep things separated out, by creating the table view controllers and then adding .view as a subview of the container, but if you do that you'll have to manually call viewWillAppear and viewWillDisapear (which is not very hard as you just call them when swapping out tables when the segmented control is touched).

提交回复
热议问题