安卓:设置web视图一个可读的字体大小 [英] Android: Set a readable font size for webView
问题描述
我使用web视图来显示HTML内容。
文字大小是可读的平板电脑。但是小的智能手机,文本显示为点。用户必须捏缩放阅读。
有没有什么办法来设置一个固定大小,这将是在两个平板电脑和智能手机?
WebSettings WS = webView.getSettings();
-
setTextSize:
ws.setTextSize(ws.TextSize.NORMAL);
枚举指定文本大小。 SMALLEST
50%, SMALLER
75%,正常值
为100%,放大
为150%, LARGEST
为200%,
-
或者用这个
ws.setDefaultFontSize(12);
I'm using webView to display HTML content. The text size is readable for tablets. However on small smartphones, the text appears as dots. The user has to pinch-zoom to read it. Is there any way to set a fixed size which will be readable on both tablets and smartphones?
WebSettings ws= webView.getSettings();
setTextSize:
ws.setTextSize(ws.TextSize.NORMAL);
Enum for specifying the text size.
SMALLEST
is 50%,
SMALLER
is 75%,
NORMAL
is 100%,
LARGER
is 150%,
LARGEST
is 200%,
Or use this one
ws.setDefaultFontSize(12);
这篇关于安卓:设置web视图一个可读的字体大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!