我正在使用此代码来检测从 monotouch.dialog 中的输入元素的键盘返回。
RltEntryElement createServerUrlEntry(){
try {
ServerNameEntryElement = new EntryElement ("Website url","placeholder",
"value");
ServerNameEntryElement .ReturnKeyType = UIReturnKeyType .Done ;
ServerNameEntryElement.ShouldReturn += ShouldReturnMethd;
return ServerNameEntryElement ;
} catch (Exception ex) {
RltLog .HandleException (ex);
return null ;
}
}
public bool ShouldReturnMethd ()
{
RltLog .LogInfo ("Helllllllllllllo");
return false ;
}
在按下“完成”后,它可以正常工作并记录 "Helllllllllllllo"
。但键盘不会消失。我应该如何使用它才能正常工作?
最佳答案
只需调用“ResignFirstResponder”
public bool ShouldReturnMethd ()
{
RltLog.LogInfo ("Helllllllllllllo");
ServerNameEntryElement.ResignFirstResponder(true);
return false;
}
关于iphone - 检测 entryelement 的键盘何时返回 monotouch.dialog,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16538842/