ServerNameEntryElement

ServerNameEntryElement

我正在使用此代码来检测monotouch.dialog中entry元素的键盘返回。

   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  ;
        }

按下'Done'后,它可以工作并记录"Helllllllllllllo"。但是键盘却没有消失。我应该用它来做什么?

最佳答案

只需致电“ResignFirstResponder”

public bool ShouldReturnMethd ()
{
    RltLog.LogInfo ("Helllllllllllllo");
    ServerNameEntryElement.ResignFirstResponder(true);
    return false;
}

08-18 20:50