Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android studio layout size folders

I'm trying to create a different layout for 1080dp and others using "layout-sw1080dp" folder but it seems android studio completely ignores it and loads from the default layout folder.

I've tried another way - setting different dimensions using values-sw1080dp and still nothing!

What is the correct way to write different layouts for different screen sizes?

like image 284
Bended Avatar asked Feb 11 '23 00:02

Bended


2 Answers

DP is not the same as PIXEL!!!

You think it's ignoring because devices with 1080dp do not exist (yet?).

  • values-sw720dp: that's for Nexus 9 and 10 inch tablets
  • values-sw600dp: that's for 7 to 8 inch tablets
  • values-sw360dp: that's for small phones

I suggest you installing this app https://play.google.com/store/apps/details?id=nl.qbus.sizemeup&hl=en on your devices, it shows the size of each devive in pixels and in DP.

Also, read more about it here http://developer.android.com/guide/practices/screens_support.html

like image 173
Budius Avatar answered Feb 15 '23 10:02

Budius


By default, Android Studio (version > 0.8) groups resources with the same name into one folder, with their distinguishing qualifiers in a muted grey. Be sure you're also using the correct qualifiers.

enter image description here

enter image description here

like image 22
Tevin J Avatar answered Feb 15 '23 10:02

Tevin J