Wednesday, February 26, 2014

webview zoom button in the lower right corner can be removed


When set to support webview page zoom, when zooming the page, the zoom button on the bottom right corner can hide or change it coordinates? ? ?<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
There are methods that can be set. . Soso online. . What zoomView of
Reply:
Upstairs brothers elaborate under what
Reply:
webView.getSettings () setBuiltInZoomControls (false);.
Try this.
Reply:
Upstairs can indeed, webView.getSettings () setBuiltInZoomControls (false);.
But do have a problem, that is double-click, drag and other commands are not easy to use
The problem is not the perfect solution. If complete solution, can only be rewritten in a portion of framework code WebView because ZoomControl already embedded in the WebView.java.
Referring to an earlier version of QQ browser, it does not solve the problem, so it can not zoom, start time point directly to large font settings, ignore. Mounted invisible
UC rewritten WebView, jni also rewrote directly call the original webkit js libraries. UC started writing on a clear screen, comes with core libraries.
Want to learn, it can decompile. I tried, decompile very clear, individual classes are full.
Use tools: dex2jar apktool



Reply:
Scaling can achieve their own
Reply:
About ways to change the position of the zoom button
/ / Define a global variable
private View control;
Hide the system default
/ /WebSettings mWebSettings = webView.getSettings ();
mWebSettings.setBuiltInZoomControls (false);
/ / Every time the page is reloaded following the calling method
private void changeZoomControls (WebView webView) {
/ / Let's zoom buttons centered
if (control == null) {
control = webView.getZoomControls ();
FrameLayout layout = (FrameLayout) getWindow (). GetDecorView ()
. FindViewById (android.R.id.content);
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams (
FrameLayout.LayoutParams.WRAP_CONTENT,
FrameLayout.LayoutParams.WRAP_CONTENT, Gravity.BOTTOM
| Gravity.CENTER);
/ / Params.bottomMargin = 10;
/ / Params.rightMargin = 10;
layout.addView (control, params);
}
}

Reply:
settings.setDisplayZoomControls (false);
Reply:
Foreigners solved. Pro-test available
http://blog.csdn.net/qihigh/article/details/13777023

No comments:

Post a Comment