Get UITableView to scroll to the selected UITextField and Avoid Being Hidden by Keyboard

后端 未结 13 977
鱼传尺愫
鱼传尺愫 2020-11-29 17:47

I have a UITextField in a table view on a UIViewController (not a UITableViewController). If the table view is on a UITableViewC

相关标签:
13条回答
  • 2020-11-29 18:34

    Another simple solution is adding an additional space for the footer of the last table section:

    - (float)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
        if (section == lastSection) {
            return keyboard height;
        }
        return 0;
    }
    

    We can add our icon into this area as well. :)

    0 讨论(0)
提交回复
热议问题