Search code examples
iosswiftuitableviewcell

TableView Static Cell: how to add constraint to bottom to the cell


I would like to add a constraint on a static cell to keep it at the bottom of the tableView, but in storyboard the constraints are not clickable, is there a way to set it programmatically in Swift? Now there is a white space after my last cell (the one with logout and save button), which doesn't look very nice :

screenshot

As here the screenshot is white on white it is not really visible, so you might want to save the image to have a proper look.


Solution

  • UITableView has a property.

    @property(nonatomic, retain) UIView *tableFooterView
    

    Returns an accessory view that is displayed below the table.

    Second option would be adding your custom view and setting up constraints along the lines of: v:|-[table view]-[custom bottom view]-|

    enter image description here