【发布时间】:2011-02-08 21:57:05
【问题描述】:
我有两个文本字段电子邮件和密码。当字段显示在常规视图上时,以下代码可以正常工作,但当它们位于弹出窗口时,resignFirstResponder 不起作用(becomeFirstResponder 工作)。两个字段都调用了 textFieldsShouldReturn。 知道我是否遗漏了什么? 谢谢!
- (BOOL)textFieldShouldReturn:(UITextField *)theTextField {
if (theTextField == email) {
[password becomeFirstResponder];
return NO;
}
[theTextField resignFirstResponder];
return NO;
}
【问题讨论】:
-
听起来像一个错误。我建议在 bugreport.apple.com 上提交报告。
-
当 textFields 在 modalPresentationStyle = UIModalPresentationFormSheet 的模式视图中时遇到同样的问题
-
我也遇到了这个错误。
-
参考stackoverflow.com/questions/3372333/
标签: iphone ipad uipopovercontroller