[英]Replace textfield's keyboard on uipopover in UIwebview
我有帶有textfields
HTML頁面,並且在UIWebView
觸摸此文本textfield
中的任何一個之后,我需要向UIPopOver
顯示靜態信息並隱藏鍵盤。 我該怎么做?
將文本字段的inputview
設置為nil。
textField.inputView = nil;
將此代碼放在您的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
}
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.