UITableView - Keep bottom-most cell scrolled to the top?

前端 未结 3 1157
南方客
南方客 2021-01-28 07:43

Im creating a music based app. The playlist screen is a UITableView. It has 3 sections: Previous Tracks, Now Playing, Next Tracks. They are in order as follows:

         


        
相关标签:
3条回答
  • 2021-01-28 08:16

    Do not overwrite the inset value somewhere else, as in my case;)

    0 讨论(0)
  • 2021-01-28 08:30

    I had the same problem, but The issue was in updating/reloading the UITableView from background thread. Just in case if someone else have the same problem as me.

    0 讨论(0)
  • 2021-01-28 08:40

    Look at the contentInset property which the table view inherits. You will have to set the bottom inset just so that the bottom most cell is visible.

    Example:

    self.tableView.contentInset = UIEdgeInsetsMake(0, 0, self.tableView.frame.size.height - 88, 0);
    
    0 讨论(0)
提交回复
热议问题