UITableView tableFooterView shows at the top of the UITableView - wrong

前端 未结 7 2481
北海茫月
北海茫月 2021-02-08 15:37

I have created a very simple test case to reproduce this issue.

I am trying to set a footer view programmatically to a tableview. Please note that I am referring to the

7条回答
  •  眼角桃花
    2021-02-08 16:05

    Do not set translatesAutoresizingMaskIntoConstraints = false on a UIView being assigned to tableView.tableFooterView.

    In your case, this is footerContainer. I had this same problem. It was mentioned in a comment on the question, but I still spent hours troubleshooting before I noticed I was doing that, so I am putting it here as a possible answer as well.

提交回复
热议问题