NivardJ
NivardJ

Reputation: 45

How to support different screensizes (different phones) with android

For a school project I have to create an app, but now I have a question. I made a layout and changed the screensize to see if the layout was still the same, but it wasn't unfortunately. I hope someone can help me with this. Here are some screenshots:

The first picture is 5.5 inch and the second picture is 5 inch

enter image description here

Upvotes: 0

Views: 74

Answers (2)

D.Pacheco
D.Pacheco

Reputation: 540

For this view I think that the better way to make the view resize, depending the device screen, is working with LinearLayout and weight_sum, giving a layout_weight value to each child depending the size of each.

Here a good tutorial.

Upvotes: 1

Jayesh
Jayesh

Reputation: 111

You can separate difference mobile phone using its screen size, android os etc...

Folder name like: res/layout-hdpi -for high density device res/layout-xdpi -for high density device res/layout-xxdpi -for high density device

or

res/layout-w320dp-h640dp

or

res/layout-sw600dp -for tablet 7inch

Upvotes: 0

Related Questions