Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android webview setdefaultfontsize(int size), what is the size unit?

android webview

webview.setdefaultfontsize(int size);

what is the size unit?

webview.getSettings().setDefaultFontSize(20);

Is it 20pt or 20dp or other uinit?

like image 570
Evan Lee Avatar asked Jan 01 '13 04:01

Evan Lee


1 Answers

unit for font is sp

sp

Scale-independent Pixels - this is like the dp unit, but it is also scaled by the user's font size preference. It is recommend you use this unit when specifying font sizes, so they will be adjusted for both the screen density and user's preference.

for more information about sp,dp,pixels please refer here

like image 182
Nirav Tukadiya Avatar answered Nov 09 '22 18:11

Nirav Tukadiya