Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 我可以禁止键盘在UIWebView中显示吗?_Iphone_Objective C_Ipad_Uiwebview - Fatal编程技术网

Iphone 我可以禁止键盘在UIWebView中显示吗?

Iphone 我可以禁止键盘在UIWebView中显示吗?,iphone,objective-c,ipad,uiwebview,Iphone,Objective C,Ipad,Uiwebview,当在UIWebView中选择网页元素时,是否可以禁用键盘显示?注册键盘通知: [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow) name:UIKeyboardWillShowNotification object:nil]; 然后,您可以通过在keyboardWillShow中放置以下代码来阻止它显示: UITextField *dummyTextField =

当在UIWebView中选择网页元素时,是否可以禁用键盘显示?

注册键盘通知:

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow) name:UIKeyboardWillShowNotification object:nil];
然后,您可以通过在keyboardWillShow中放置以下代码来阻止它显示:

UITextField *dummyTextField = etc. 
//Basically, create a dummy uitextfield that you never show. 
//I can't remember all the syntax :)


[dummyTextField becomeFirstResponder];
[dummyTextField resignFirstResponder];
//Keyboard should be gone. Hoorah!
不确定这是否100%可以正常工作。如果键盘开始设置动画,然后再次隐藏,则可以使用

[UIView enableAnimations:NO];
如果键盘不喜欢在显示时退出,那么可以尝试将虚拟文本字段的inputView属性改为某个虚拟UIView


希望这能让你有所收获

注册键盘通知:

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow) name:UIKeyboardWillShowNotification object:nil];
然后,您可以通过在keyboardWillShow中放置以下代码来阻止它显示:

UITextField *dummyTextField = etc. 
//Basically, create a dummy uitextfield that you never show. 
//I can't remember all the syntax :)


[dummyTextField becomeFirstResponder];
[dummyTextField resignFirstResponder];
//Keyboard should be gone. Hoorah!
不确定这是否100%可以正常工作。如果键盘开始设置动画,然后再次隐藏,则可以使用

[UIView enableAnimations:NO];
如果键盘不喜欢在显示时退出,那么可以尝试将虚拟文本字段的inputView属性改为某个虚拟UIView


希望这能让你有所收获

我尝试使用虚拟文本字段和UIView,但它不起作用(iOS9)。对我有效的方法是调用webView.endEditing(true)。请看,我尝试使用虚拟文本字段和UIView,但它不起作用(iOS9)。对我有效的方法是调用webView.endEditing(true)。看见