我在 TableViewCell
上有一个文本字段。当我单击“完成”按钮时,文本字段会删除。当我向下滚动并向上滚动时,文本字段再次可见。
addSubview(search)
search.leftViewMode = UITextField.ViewMode.always
search.placeholder = "Поиск лекарств и товаров"
search.backgroundColor = .white
search.layer.cornerRadius = 10
search.dropShadow(color: .black, opacity: 0.5, offSet: CGSize(width: 5, height: 5), radius: 5, scale: false)
最佳答案
func textFieldShouldReturn(textField: UITextField) -> Bool {
self.searchTextFieldShouldReturn = true
textField.resignFirstResponder()
return true
}
关于ios - UITextfield 在完成按钮单击 tableview 标题时删除,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57353046/