简体   繁体   English

UITextField辞职第一响应者在Containerview中不工作

[英]UITextField resign first responder is not working in Containerview

I have container,in child class having some of the textfield after saved the text field value,the child class textfield cannot resigned.i was resigned the textfield coding put inside the viewWillAppear method,textFieldShouldReturn and am trying to refresh the containerview by the following way, 我有容器,在子类中保存了文本字段值之后,在子类中有一些文本字段,子类文本字段无法辞职。我被辞职了放置在viewWillAppear方法,textFieldShouldReturn内的文本字段编码,并尝试通过以下方式刷新容器视图,

 1.Begin Appearance Transition
 2.End Appearance Transition

but that is not resigned?please provide any solution fot that,much appreciated. 但这并不能辞职,请提供任何解决方案,对此深表感谢。

NOTE:textField delegate also set. 注意:也设置了textField委托。

如果您希望所有文本字段都[self.container.view endEditing:YES] ,请调用此方法[self.container.view endEditing:YES]

请尝试以下代码:

[[UIApplication sharedApplication] sendAction:@selector(resignFirstResponder) to:nil from:nil forEvent:nil];

输入以下代码以关闭键盘:

[self.view endEditing:YES];

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM