How to position UITableViewCell at bottom of screen?

前端 未结 14 576
旧时难觅i
旧时难觅i 2020-12-08 03:25

There are one to three UITableViewCells in a UITableViewView. Is there a way to always position the cell(s) at the bottom of screen after rel

14条回答
  •  [愿得一人]
    2020-12-08 03:31

    All answers got some quirks with dynamic rowHeight and/or animations. For me the best working solution was a transformation of the table (flipY):

    tableView.transform = CGAffineTransform (scaleX: 1,y: -1)
    

    inside cellForRowAt:

    cell.contentView.transform = CGAffineTransform (scaleX: 1,y: -1)
    cell.accessoryView?.transform = CGAffineTransform (scaleX: 1,y: -1)
    

    You may also reverse your data-array and may also flip section-header/footer. Also your footer becomes your new header - but hey, it works.

提交回复
热议问题