简体   繁体   中英

Android layouts under subfolders

Is it possible to create subfolders under res/layout and place the layout XML files there so that one can call a view like setContentView(R.layout.questions.create); or setContentView(R.layout.questions/create); ?

From my tests, no.

You might want to consider a naming convention:

  • questions_create
  • questions_list
  • answers_list

Or, investigate Android library projects: http://androidblogger.blogspot.com/2010/09/android-library-projects.html - seems pretty good to add more structure.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM