これは操作の順序の問題です
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
[nc addObserver:self
selector:@selector(keyboardWillShow:)
name:UIKeyboardWillShowNotification
object:nil];
[nc addObserver:self
selector:@selector(keyboardWillHide:)
name:UIKeyboardWillHideNotification
object:nil];
そして、テキスト ボックスを UITableViewCell に追加します。
[textField addTarget:self
action:@selector(textFieldBegin:)
forControlEvents:UIControlEventEditingDidBegin];
[cell addSubview:textField];
textFieldBegin では、scrollToRowAtIndexPath を編集中のセルに移動します。
keyboardWillShow では、tableView のフレームを調整して、キーボードを表示できるようにします。
textFieldBeginはkeyboardWillShowの前 に呼び出されるため、最初に表示されるときはスクロールする余地がありません。
この見落としを修正する適切な方法はありますか?