Layout for device with same resolution but different screen size in android

I need to add two layouts for two different devices with the same resolution, but with a different screen size. Since both have the same layout i.e. hdpi. If I try to resize the text for one device, it gets smaller for a device with a smaller screen size.

+3


source to share


2 answers


If you are giving the text size in px this is not the way to do it, but use sp.

Take a look at this discussion about the benefits of dp and sp.



android layout at different screen sizes

0


source


You can define a different size in a dimen.xml

different folder filevalue



0


source







All Articles