How can I make the footerview always stay at the bottom in UITableViewController?

前端 未结 4 2000
日久生厌
日久生厌 2021-02-13 20:56

I am using a UITableviewcontroller and I want the footer view to always stay at the bottom of the screen. However, the y

4条回答
  •  無奈伤痛
    2021-02-13 21:07

    A footer is always added to the bottom of the content size. So my approach is

    Approach 1: (Available for Both Static and Dynamic TableView)

    Add a ViewController in Storyboard and set your footer view(or button) at the bottom of the ViewController.

    Add a ContainerView in the ViewController and set constraint

    Add a UITableViewController and embedded the tableview in the container view

    Approach 2: (Available for both Dynamic TableView)

    Add a ViewController, set footer view in the bottom, add UITableView and set your auto layout.

    You can't set static tableview in a UIViewController

提交回复
热议问题