Mohammed Imran N
Mohammed Imran N

Reputation: 1319

How to design a layout for 1080*1920 pixel screens? Which layout folder works for Samsung galaxy S4?

I'm creating an application which works for all types of screens, but I'm having problems while creating layouts for the Samsung Galaxy S4 1080*1920 (5 inch screen).

Since 1080*1920 falls under 480dpi(XXHDPI), I have created folder called layout-sw480dp and have placed my file in there.

When I look at it from xml view it looks perfect, but when I run it and check, the alignment has been changed.

I have created other folders, such as layout-xxhdpi as well, and tried then but the alignment problem persists.

Are there any specific folders to place files for Samsung Galaxy S4?

I have attached links to show the problem I'm facing.

Thanks in advance

Here is the link for the screenshots

https://www.dropbox.com/s/65pqq65qm2va8jc/xml.gif

https://www.dropbox.com/s/3ewytmrt1jy7xc9/screenshot2.gif

Upvotes: 0

Views: 2124

Answers (1)

flx
flx

Reputation: 14226

If you want to have a layout for your S4, you need to use the values-sw360dp folder.

The conversion is like this: px * 160 / dpi. In your case: 1080 * 160 / 480 = 360.

But anyway, your layout should work on all devices, not only the S4.

Upvotes: 4

Related Questions