Galaxy SIII ignoring setDefaultZoom? UPDATE: JellyBean issue with WebView?

六月ゝ 毕业季﹏ 提交于 2019-12-24 06:59:27

问题


UPDATE: This is actually a JellyBean issue:

Emulator running ICS:

Emulator running JB:

So the emulator settings are the same (API level different obviously). Tested and verified on 3 differerent devices: Nexus S, Galaxy Nexus, and GS3.

I have a webView acivity that display's a couple of different web pages. I change the Default Zoom Settings based on what url is being displayed. The following line :

webSettings.setDefaultZoom(WebSettings.ZoomDensity.FAR);

was producing the view seen in ICS ( I get same behavior with anything 2.2- 4.0.4), but with JellyBean it seems like the DefaultZoom is not being recognized.

Any one else encounter this ? I feel like this is a bug with JellyBean, but wanted to check back here before submitting.


回答1:


It's kind of a old thread, but if you are still having the same issue I found a setting that fixed a similar issue for me. The issue occurred on Jelly Bean (4.1.2) on a Samsung Tablet.

webView.getSettings().setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN);



回答2:


Try this and tell me if it works... it should handle the page fitting on the fone screen!

 WebView wv = (WebView) findViewById(R.id.webview);
    wv.getSettings().setLoadWithOverviewMode(true);
    wv.getSettings().setUseWideViewPort(true);



回答3:


I "fixed" it on my own app by using getSettings().setUseWideViewPort(true).

However that is a misbehavior - and looks wrong on all the other devices. ** Shame to Samsung for breaking the behavior of the API ** Devices working correctly: Galaxy Nexus, HTC One X, etc..



来源:https://stackoverflow.com/questions/12288344/galaxy-siii-ignoring-setdefaultzoom-update-jellybean-issue-with-webview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!