Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我不想隐藏键盘,而是模拟敲击完成/返回键类型,所以它会调用我的功能之一。
UITextFieldInputTraits?
UITextFieldInputTraits
如果您能以正确的方式指导我,我将不胜感激。
使用 UITextField 委托方法:
- (BOOL)textFieldShouldReturn:(UITextField *)textField { [self myFoo]; return NO; }
如果您需要模拟点击返回调用此函数,如:
[self textFieldShouldReturn:nil];