Can the Android layout folder contain subfolders?

前端 未结 20 2660
暗喜
暗喜 2020-11-22 03:10

Right now, I\'m storing every XML layout file inside the \'res/layout\' folder, so it is feasible and simple to manage small projects, but when there is a case of large and

20条回答
  •  礼貌的吻别
    2020-11-22 03:58

    The answer is no.

    I would like to draw your attention towards this book Pro Android 2 that states:

    It is also worth noting a few constraints regarding resources. First, Android supports only a linear list of files within the predefined folders under res. For example, it does not support nested folders under the layout folder (or the other folders under res).

    Second, there are some similarities between the assets folder and the raw folder under res. Both folders can contain raw files, but the files within raw are considered resources and the files within assets are not.

    Note that because the contents of the assets folder are not considered resources, you can put an arbitrary hierarchy of folders and files within it.

提交回复
热议问题