Set focus to UITextField in tableCell

前端 未结 3 1913
长情又很酷
长情又很酷 2021-02-12 07:21

I am creating a table view with UITextFields dynamically.

l_textField = [[UITextField alloc] initWithFrame:TextFieldFrame];
l_textField.tag = cellRo         


        
3条回答
  •  北荒
    北荒 (楼主)
    2021-02-12 07:38

    change [field resignFirstResponder]; with [field becomeFirstResponder];

    resignFirstResponder is used to remove keyboard (focus) from text field

提交回复
热议问题