在web视图Android平板上的HTML页面的密码字段在双攻一片空白 [英] webview going blank upon double tapping on password field of html page on Android Tablet
问题描述
问题:Webview是在双攻上Android平板html页面的密码字段一片空白。就在html页面上输入用户名和密码,没有任何问题。
在测试了:三星Galaxy平板电脑(GT-P7510)和摩托罗拉Xoom
布局文件片段:
块引用><的LinearLayout
机器人:layout_width =@扪/ layout_xlarge_width
机器人:layout_height =WRAP_CONTENT
机器人:layout_gravity =中心
机器人:填充=20dip
机器人:方向=垂直>
<的TextView
机器人:ID =@ + ID / urlview
机器人:layout_width =FILL_PARENT
机器人:layout_height =WRAP_CONTENT
机器人:文字=@字符串/测试
/>
<微调
机器人:ID =@ + ID /简介
机器人:layout_height =WRAP_CONTENT
机器人:layout_width =FILL_PARENT
/> < / LinearLayout中> <的WebView
机器人:ID =@ + ID / web视图
机器人:layout_width =FILL_PARENT
机器人:layout_height =FILL_PARENT
机器人:知名度=水涨船高
/>
< / LinearLayout中>code设置的WebView:
web视图=(的WebView)findViewById(R.id.webview);
webView.getSettings()setJavaScriptEnabled(真)。
。webView.getSettings()setJavaScriptCanOpenWindowsAutomatically(真);
webView.clearCache(真);
webView.setScrollBarStyle(View.SCROLLBARS_OUTSIDE_OVERLAY);
setUserAgent(的getString(R.string.user_agent_suffix));其他:
上的WebView添加支持缩放或建立联系,注重听者没有帮助。
感谢您!
解决方案我在我的应用程序的一些问题。似乎有什么漏洞会影响所有的蜂窝片。
问题消失,如果打开硬件加速。但是,硬件加速的WebView有问题,业绩和透明度。
对于我来说工作正常,软件渲染的WebView对硬件加速的窗口:
mWindow.setFlags(
Window.LayoutParam.FLAG_HARDWARE_ACCELERATED,
Window.LayoutParam.FLAG_HARDWARE_ACCELERATED);
...
mWebView.setLayerType(View.LAYER_TYPE_SOFTWARE);PS:当然,你也可以启用硬件加速在您的清单文件整个应用程序
Issue: webview is going blank upon double tapping on password field of html page on Android Tablet. Just typing user name and password on the html page has no problem.
Tested on: Samsung Galaxy tablet (GT-P7510) and Motorola Xoom
layout file snippet:
<LinearLayout android:layout_width="@dimen/layout_xlarge_width" android:layout_height="wrap_content" android:layout_gravity="center" android:padding="20dip" android:orientation="vertical"> <TextView android:id="@+id/urlview" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/test" /> <Spinner android:id="@+id/profile" android:layout_height="wrap_content" android:layout_width="fill_parent" /> </LinearLayout> <WebView android:id="@+id/webview" android:layout_width="fill_parent" android:layout_height="fill_parent" android:visibility="gone" /> </LinearLayout>
Code to setup webview:
webView = (WebView) findViewById(R.id.webview); webView.getSettings().setJavaScriptEnabled(true); webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true); webView.clearCache(true); webView.setScrollBarStyle(View.SCROLLBARS_OUTSIDE_OVERLAY); setUserAgent(getString(R.string.user_agent_suffix));
Other:
Adding support for zoom on webview or setting up touch and focus listener did not help.
Thank you!
解决方案I had some problems in my application. Seems what bug affects all Honeycomb tablets.
The problem goes away, if you turn on hardware acceleration. But hardware accelerated WebView has problem with performance and transparency.
For me works fine software rendered WebView on hardware accelerated window:
mWindow.setFlags( Window.LayoutParam.FLAG_HARDWARE_ACCELERATED, Window.LayoutParam.FLAG_HARDWARE_ACCELERATED); ... mWebView.setLayerType(View.LAYER_TYPE_SOFTWARE);
PS: Of course you can also enable hardware acceleration for entire application in your manifest file.
这篇关于在web视图Android平板上的HTML页面的密码字段在双攻一片空白的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!