如何在android中增加webview的字体大小?我已经给出了下面的代码,但它没有用。谁能告诉我怎么做?
blogWebView.getSettings().setDefaultFontSize(14);
答案 0 :(得分:1)
你可以在webview中使用缩放控制。见下面的代码
FrameLayout mContentView = (FrameLayout) getWindow().
getDecorView().findViewById(android.R.id.content);
final View zoom = this.mWebView.getZoomControls();
mContentView.addView(zoom, ZOOM_PARAMS);
zoom.setVisibility(View.GONE);
private static final FrameLayout.LayoutParams ZOOM_PARAMS =
new FrameLayout.LayoutParams(
ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT,
Gravity.BOTTOM);
webview.getSettings().setDefaultZoom(WebSettings.ZoomDensity.FAR)