Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 webView 来显示 HTML 内容。文本大小对于平板电脑是可读的。但是在小型智能手机上,文本显示为点。用户必须捏缩放才能阅读它。有什么方法可以设置在平板电脑和智能手机上都可以读取的固定大小?
WebSettings ws= webView.getSettings();
设置文本大小:
ws.setTextSize(ws.TextSize.NORMAL);
用于指定文本大小的枚举。 SMALLEST是 50%, SMALLER是 75%, NORMAL是 100%, LARGER是 150%, LARGEST是 200%,
SMALLEST
SMALLER
NORMAL
LARGER
LARGEST
或者使用这个
ws.setDefaultFontSize(12);