Disabling automatic scrolling of UITableView when editing UITextField inside UITableViewCell

后端 未结 9 880
别跟我提以往
别跟我提以往 2020-11-30 00:40

I\'m using custom UITableViewCells inside my UITableView. Each of these UITableViewCells is pretty high and contains a UITextFie

9条回答
  •  温柔的废话
    2020-11-30 01:06

    The autoscroll-behavior is located in the UITableViewController functionality.

    To disable the automatic scrolling I found two ways:

    1. Use instead of the UITableViewController simply a UIViewController - set the datasource and delegate on your own.
    2. Override the viewWillAppear method and don't call [super viewWillAppear: animated]

    With both solution you disable not only the Autoscroll, but also some other nice but not essential features, that are described in the overview of Apple´s class reference:

    https://developer.apple.com/documentation/uikit/uitableviewcontroller

提交回复
热议问题