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?
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
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.
The modifier you're using sw<N>dp
(smallest width) represents resources for the shortest of the screen's available height and width.
Are you sure your shortest screen's dimension are not less than 1080dp?
Read more about resource folder modifiers here.
来源:https://stackoverflow.com/questions/28301472/android-studio-layout-size-folders