如何以编程方式禁用iOS 8的WebView中的预测视图 [英] How to programmatically disable predictive view in WebView of iOS 8

查看:131
本文介绍了如何以编程方式禁用iOS 8的WebView中的预测视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为iOS 8设计自定义键盘。它可以在任何UITextField上正常工作,但是当它在UIWebView中时,它会显示预测。由于允许在iOS 8中使用自定义键盘,我认为应该有一种方法来禁用此视图。任何帮助,将不胜感激。以下图片的红色区域:

I'm designing a custom keyboard for iOS 8. It works fine on any UITextField but when it's in UIWebView, it shows predictions. Since it's allowed to have custom keyboard in iOS 8 I assume there should be a way to disable this view. Any help would be appreciated. Red area of the following picture:

推荐答案

我找到了解决此问题的解决方法。如果你在HTML文件中添加type =email而不是type =text,如下图所示,iOS键盘将不会显示预测视图:)

I found a workaround solution for this problem. If you add type="email" instead of type="text" in your HTML file like bellow, iOS keyboard won't show the predictive view :)

<input type="email"/>

我暂时将此答案标记为解决方案但是如果有人从Objective-C找到了解决方法部分,我将测试并接受该答案作为解决方案。

I temporarily mark this answer as the solution but if someone finds a way to do it from Objective-C part, I'll test and accept that answer as the solution.

这篇关于如何以编程方式禁用iOS 8的WebView中的预测视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆