不能在Web视图里面键入 [英] Can't type inside a Web View
本文介绍了不能在Web视图里面键入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个Web视图交互的问题。我展示的Web视图中的HTML登录表单,我无法里面键入任何形式输入字段。我可以用链接,选择框,按钮等。
I have a problem interacting with a Web View. I'm showing an html login form within a web view and I can't type inside of any of the input fields of the forms. I do can interact with the links, select boxes, buttons, etc.
下面是我的code的一个例子。基本上我检索从XML Web视图并设置它WebViewClient和WebChromeClient。
Here is an example of my code. Basically I'm retrieving the web view from the xml and setting it a WebViewClient and a WebChromeClient.
webview = (WebView) findViewById(R.id.loginWebview);
webview.getSettings().setJavaScriptEnabled(true);
WebViewClient client = new WebViewClient();
webview.setWebViewClient(client);
webview.setWebChromeClient(new WebChromeClient());
webview.loadUrl("http://www.google.com");
任何想法?
推荐答案
我有同样的问题太多,你可以执行以下操作来解决这个问题:
I had the same problem too, you can do the following to solve this:
WebView webView = (WebView)findViewById(R.id.yourWebView);
webView.getSettings().setJavaScriptEnabled(true);
webView.requestFocus(View.FOCUS_DOWN);
这里有另一篇文章。
的Android的WebView拒绝用户输入
这篇关于不能在Web视图里面键入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文