I want to create separate folders for my layouts, like this in my resource directory:
layout-land
layout-port
this is ok, but this:
layout-small-land
layout-small-port
or
layout-land-small
layout-port-small
Results in: 'Invalid resource directory name'
What gives?
I haven't found anything else on the web that references this structure, but the following blog post shows an example where the author uses ldpi (and I'm sure mdpi and hdpi) instead of small, normal and large (as the android reference docs online would suggest). Have a look at the link below and maybe try that structure:
http://android.amberfog.com/?p=276
It will give you a
"invalid resource error"
until the folder is empty. If you fill it with the.xml
files (they have to match exactly in everylayout-<qualifier>
folders) it gives you no error.EG:
it's ok
layout-small-land
andlayout-small-port
are the correct answers, and they compile just fine for me. Perhaps there is something else amiss in your directory structure.You can specify the screen density instead of a size like Large or Small
Example:
More info in the following link:
https://developer.android.com/guide/topics/resources/resources-i18n.html#AlternateResources
For using Large, Medium, Small this is the way: