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.
Thanks
Adding fonts to a TextView To set a font for the TextView , do one of the following: In the layout XML file, set the fontFamily attribute to the font file you want to access. Open the Properties window to set the font for the TextView .
Click Ctrl + Shift + A. A new box will appear, search font there then you can see a lot of options then click on increase font size.
To set Android Button font/text size, we can set android:textSize attribute for Button in layout XML file. To programmatically set or change Android Button font/text size, we can pass specified size to the method Button. setTextSize(specific_size).
I finally found it:-
WebSettings webSettings = webView.getSettings();
either setTextSize
or
webSettings.setTextSize(WebSettings.TextSize.SMALLEST);
This one works too:-
webSettings.setDefaultFontSize(10);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With