有人能解决我的问题吗? 我有一个 UITextField 并想在按下 Return 后关闭键盘。 我添加了 UITextFieldDelegate 并想在我的 TextField 上设置委托(delegate),但错误仍然存在...
最佳答案
您想使用哪个。 TextField 还是 TextView?
因为您创建了“TextView”的“IBOutlet”,但将委托(delegate)设置为“TextField”。
如果您想使用“TextField”,则从 Storyboard中删除“TextView”并使用“TextField”代替它并创建它的“IBOutlet”。
如果您想使用“TextView”,则使用“UITextViewDelegate”而不是“UITextFieldDelagate”。
关于ios - 在 UITextField 中关闭键盘,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35553873/