如何更改 Android WebView 中的 FontSize? [英] How to change the FontSize in an Android WebView?

查看:31
本文介绍了如何更改 Android WebView 中的 FontSize?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何手动更改 webview 的字体大小?例如当页面在 webview 中加载时,字体大小就像 24pt.而且对于我的 android 屏幕来说太大了.我已经查看了网络设置",但似乎两者无关.

How can you manually change the font size of a webview? e.g. When the page loads up in the webview the font size is like 24pt. and way too large for my android's screen. I've looked into the "websettings" but it seems that the two are not related.

谢谢

推荐答案

我终于找到了:-

WebSettings webSettings = webView.getSettings();

setTextSize

webSettings.setTextSize(WebSettings.TextSize.SMALLEST);

这个也可以:-

webSettings.setDefaultFontSize(10);

这篇关于如何更改 Android WebView 中的 FontSize?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆