UITableviewcell 中的 UITextField。可编辑但键盘不显示
UITextField inside UITableviewcell. editable but keyboard is not showing
不是这里的 iOS 专家。使用 xcode 11 和最新的 iOS 和 objective C。我希望用户能够添加一些文本。文本字段是可编辑的,但我看不到键盘。如果我单击下一个单元格,我会在控制台中收到约束警告。关于这个主题有很多 SO 问题。但没有任何帮助。 textFieldShouldBeginEditing() 确实被调用了,我 returning YES.
2020-09-13 12:47:18.294987-0700 EWF[31667:891775] -[ewfSubMenuViewController textFieldShouldBeginEditing:] tag 12377 2
2020-09-13 12:47:23.760577-0700 EWF[31667:891775] last selected 0
2020-09-13 12:47:23.760831-0700 EWF[31667:891775] -[ewfSubMenuViewController tableView:didSelectRowAtIndexPath:]: index 1 mainmenu 0
2020-09-13 12:47:25.898776-0700 EWF[31667:891775] -[ewfSubMenuViewController textFieldShouldBeginEditing:] tag 12378 1
2020-09-13 12:47:25.914790-0700 EWF[31667:891775] [LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(
"<NSLayoutConstraint:0x60000399aa80 'assistantHeight' TUISystemInputAssistantView:0x7fcf4d64d6f0.height == 38 (active)>",
"<NSLayoutConstraint:0x6000039e94f0 'assistantView.bottom' TUISystemInputAssistantView:0x7fcf4d64d6f0.bottom == _UIKBCompatInputView:0x7fcf4d744070.top (active)>",
"<NSLayoutConstraint:0x6000039e9400 'assistantView.top' V:|-(0)-[TUISystemInputAssistantView:0x7fcf4d64d6f0] (active, names: '|':UIInputSetHostView:0x7fcf4fb23800 )>",
"<NSLayoutConstraint:0x6000039f9b80 'inputView.top' V:|-(0)-[_UIKBCompatInputView:0x7fcf4d744070] (active, names: '|':UIInputSetHostView:0x7fcf4fb23800 )>"
)
尝试了所有这些:
cell.tfItemNote.delegate = self;
//cell.tfItemNote.clearButtonMode = UITextFieldViewModeNever;
//[cell.contentView addSubview:cell.tfItemNote];
//cell.accessoryType = UITableViewCellAccessoryNone;
//[cell.tfItemNote becomeFirstResponder];
tableView.userInteractionEnabled = YES;
cell.tfItemNote.userInteractionEnabled = YES;
//tableView.keyboardDismissMode = UIScrollViewKeyboardDismissModeOnDrag;
//tableView.keyboardDismissMode = UIScrollViewKeyboardDismissModeInteractive;
//cell.tfItemNote.returnKeyType = UIReturnKeyDone;
我希望在用户单击 return 时关闭键盘。
感谢任何帮助。
谢谢。
在模拟器中运行时,您可以使用快捷键Command+K切换键盘。
这是模拟器的表现,真机不会有这个问题。
不是这里的 iOS 专家。使用 xcode 11 和最新的 iOS 和 objective C。我希望用户能够添加一些文本。文本字段是可编辑的,但我看不到键盘。如果我单击下一个单元格,我会在控制台中收到约束警告。关于这个主题有很多 SO 问题。但没有任何帮助。 textFieldShouldBeginEditing() 确实被调用了,我 returning YES.
2020-09-13 12:47:18.294987-0700 EWF[31667:891775] -[ewfSubMenuViewController textFieldShouldBeginEditing:] tag 12377 2
2020-09-13 12:47:23.760577-0700 EWF[31667:891775] last selected 0
2020-09-13 12:47:23.760831-0700 EWF[31667:891775] -[ewfSubMenuViewController tableView:didSelectRowAtIndexPath:]: index 1 mainmenu 0
2020-09-13 12:47:25.898776-0700 EWF[31667:891775] -[ewfSubMenuViewController textFieldShouldBeginEditing:] tag 12378 1
2020-09-13 12:47:25.914790-0700 EWF[31667:891775] [LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(
"<NSLayoutConstraint:0x60000399aa80 'assistantHeight' TUISystemInputAssistantView:0x7fcf4d64d6f0.height == 38 (active)>",
"<NSLayoutConstraint:0x6000039e94f0 'assistantView.bottom' TUISystemInputAssistantView:0x7fcf4d64d6f0.bottom == _UIKBCompatInputView:0x7fcf4d744070.top (active)>",
"<NSLayoutConstraint:0x6000039e9400 'assistantView.top' V:|-(0)-[TUISystemInputAssistantView:0x7fcf4d64d6f0] (active, names: '|':UIInputSetHostView:0x7fcf4fb23800 )>",
"<NSLayoutConstraint:0x6000039f9b80 'inputView.top' V:|-(0)-[_UIKBCompatInputView:0x7fcf4d744070] (active, names: '|':UIInputSetHostView:0x7fcf4fb23800 )>"
)
尝试了所有这些:
cell.tfItemNote.delegate = self;
//cell.tfItemNote.clearButtonMode = UITextFieldViewModeNever;
//[cell.contentView addSubview:cell.tfItemNote];
//cell.accessoryType = UITableViewCellAccessoryNone;
//[cell.tfItemNote becomeFirstResponder];
tableView.userInteractionEnabled = YES;
cell.tfItemNote.userInteractionEnabled = YES;
//tableView.keyboardDismissMode = UIScrollViewKeyboardDismissModeOnDrag;
//tableView.keyboardDismissMode = UIScrollViewKeyboardDismissModeInteractive;
//cell.tfItemNote.returnKeyType = UIReturnKeyDone;
我希望在用户单击 return 时关闭键盘。
感谢任何帮助。 谢谢。
在模拟器中运行时,您可以使用快捷键Command+K切换键盘。
这是模拟器的表现,真机不会有这个问题。