UITableviewcell中的UITextField。可编辑但键盘未显示

时间:2020-09-13 20:02:36

标签: ios objective-c xcode uitableview uitextfield

这里不是iOS专家。使用xcode 11和最新的iOS和目标C。我希望用户能够添加一些文本。文本字段是可编辑的,但我看不到键盘。如果我单击下一个单元格,则会在控制台中收到约束警告。关于此主题有很多SO问题。但没有任何帮助。 textFieldShouldBeginEditing()确实被调用,并且我返回YES。

const badSpec = {
  selector: 'a',
  locators: {
    byThis: (element: HTMLInputElement) => element.value, 
    byThat: (element: HTMLLinkElement) => element.title
  },
}
// error is correctly given for incompatible locator 
const bad = createInteractor('link')(badSpec);

尝试了所有这些:

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 )>"
)

我希望在用户点击返回时关闭键盘。

感谢任何帮助。 谢谢。

enter image description here

1 个答案:

答案 0 :(得分:1)

在模拟器中运行时,可以使用快捷键Command + K切换键盘。

这是模拟器的行为,在真实设备上不会出现此问题。

enter image description here