0

我有 HTML 页面,textfields并且在触摸其中的任何内容之后textfieldUIWebView我需要显示UIPopOver静态信息并隐藏键盘。我怎么能做到这一点?

4

2 回答 2

0

将文本字段设置inputview为零。

textField.inputView = nil;
于 2013-07-04T12:03:36.317 回答
0

将此代码放入您的viewDidLoad方法中,它是在显示键盘时通知您的通知

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardDidShow) name:UIKeyboardDidShowNotification object:nil];

UITextField在以下通知方法中添加您的弹出视图

- (void)keyboardDidShow
{
       if(self.myTextFieldName)
        {
          [myTextFieldName resignFirstResponder]; /// resignFirstResponder/hideKeyBoard when you click on UITextFiled 
          myTextFieldName.inputView = self.PopUpView. // and add your popup view as input view of yourTextFiled         
        }

}
于 2013-07-04T12:18:17.537 回答