android - Font Size too big on LG device -


i have layout fits on mdpi tablets. however, when run application on hdpi lg tablet, font gets bigger supposed be.

an example of how scale layout , set textsize:

        int nametvheight = (int)convertdptopix (heightscale  * 11);         linearlayout.layoutparams p2 = new linearlayout.layoutparams (linearlayout.layoutparams.wrapcontent,nametvheight);         p2.gravity = gravityflags.centerhorizontal;         nametv.layoutparameters = p2;         nametv.textsize = nametvheight;         nametv.setincludefontpadding (false); 

on lg tablet, looks fontsize bigger height of textview, gets cut off @ bottom. can point out reasons and/or solutions this?

also, fontsize in settings set on normal, , font roboto default android typeface. tablet has android version 4.2.2

however, when run application on hdpi lg tablet, font gets bigger supposed be.

it because converting text size value in dp, , settextsize scales again in sp. call settextsize way

settextsize(typedvalue.complex_unit_px, size); 

Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -