-1
enter image description here私はユーザーインタラクションを有効にするボタンまたはラベルを作成する必要があります。 そして、ユーザーがtextfieldの外をタップすると、テキストフィールドを無効にしようとしました。しかし、完了できませんでした。返信を事前にスウィフトで編集可能なボタン/ラベルを作成する方法
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
{
let currentCellDescriptor = getCellDescriptorForIndexPath(indexPath)
let cell:ArrowCell = tableView.dequeueReusableCell(withIdentifier: "\(idString)") as! ArrowCell
cell.currentMinimumValueTextField.delegate = self
cell.currentaximumvaluextield.delegate = self
cell.currentMinimumValueTextField.isEnabled = false
cell.currentaximumvaluextield.isEnabled = false
}
func textFieldDidBeginEditing(_ textField: UITextField) {
textField.isEnabled = true
print("TextField did begin editing method called")
}
func textFieldDidEndEditing(_ textField: UITextField) {
print("TextField did end editing method called\(textField.text!)")
}
func textFieldShouldReturn(_ textField: UITextField) -> Bool {
textField.resignFirstResponder();
return true;
}
おかげで
お試しいただいたコードを追加してください。 –
コード – Shpuj
で質問を編集しましたもう1つの問題があります。行内のテキストフィールドのクリックがオンになっています。選択されています....テキストフィールドを選択したいと思います....ユーザーがテキストを入力できるようにする必要があります....ユーザがテキストフィールドの外にタップすると、テキストフィールドは無効にする必要があります....テキストフィールドはラベルのように振る舞います – Shpuj