Is It Good To Use Layout Weights And Relativelayout For Multiple Screens?
Solution 1:
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.
Solution 2:
i par my knowledge Linerlayout and relative layout is best for design xml in android.
Both are use diff purpose suppose
case 1: if there is large data eg from db and you want to display it on layouts then use Scroll view around layouts.
case 2: but in diff case like for design signup xml then use linear layouts and weight.
so layout is not change in any screen size of android device.
i hope this help may you.
Solution 3:
It's better I think to create different layouts. In landscape mode on big screen for example you may want to display more elements to fill the space. As edthethird stated its better to have it look good instead of identical.
Post a Comment for "Is It Good To Use Layout Weights And Relativelayout For Multiple Screens?"