I have an image with a square… In layout I want to set text inside square, so I set property margin bottom 100dp to ‘TextView’ and in HDPI phone my text is in square. That’s cool. But when I run my app on MDPI device Text looks a little bit higher then it should be.
And its understandable, because MDPI and HDPI has different resolutions…So how to be ? How to set text so, that its looks proportional on both devices?
Why don’t you just wrap the image and the text inside a FrameLayout, and give the TextView a
layout_gravity="center"attribute? With your current method, different aspect ratios will give you different positioning.