Hello android designers,
1-I have been wondering. Is it a good design approach to always use RelativeLayout and layout weights so that it work on multiple screen sizes without the need of having different layout folders?
2-Another question, I have a textview with size 12sp (scaled pixel) that looks good on medium screens but when I run it on large screen it looks really small. Shouldn’t it be scaling accordingly? According to android best practices,using sp is good for scaling. I see it really problematic, to try to guess the correct number for each screen size as 12sp already took mnultiple guesses till I found that this would suit my application relative to other components
Please share your experience/advice. I am always confused about it
Thanks
One think to keep in mind about Dip (density independent pixels) and sp (scaling pixels (?)) is that they are tuned for medium density screens. With the introduction of high-density devices, these standards are going to have to be revised by Google.
With that said:
I have better luck using RelativeLayouts and weights than I do with using explicit DIP. I usually use LinearLayout instead of RelativeLayout– but as long as elements are positioned relative to eachother instead of absolutely it doesn’t quite matter if it’s a RelativeLayout or a LinearLayout or something else entirely.
That is what happens- keep in mind 12sp is “small”, and it will be “small” text on large screens. Instead of scaling the font, scale the TextView– for example, center your text in your TextView and have your TextView take up half the screen (using Weight, no matter the screen size).
Remember that things will look different on different screen sizes– the trick is to make sure it looks good on each size, as opposed to identical.