Text size of TextView for multiple android screens (mdpi, hpdi, xhdpi,xxhdpi,xxxhdpi)? -


i making android app. there rotatable imageview in middle of screen 2 textviews (in bold) above , 2 textviews below. shows different on different screens.

just make sure in xml layout define textsize attribute in dp. since density-independent-pixel, won't affected different screen sizes.

from android docs:

when specifying dimensions, use either dp or sp units. dp density-independent pixel corresponds physical size of pixel @ 160 dpi. sp same base unit, scaled user's preferred text size (it’s scale-independent pixel), should use measurement unit when defining text size (but never layout sizes). when specify spacing between 2 views, use dp.


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

Qt QGraphicsScene is not accessable from QGraphicsView (on Qt 5.6.1) -

What is happening when Matlab is starting a "parallel pool"? -