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 textview
s (in bold) above , 2 textview
s 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
Post a Comment