Can the Android drawable directory contain subdirectories?

后端 未结 21 934
醉梦人生
醉梦人生 2020-11-22 04:13

In the Android SDK documentation, all of the examples used with the @drawable/my_image xml syntax directly address images that are stored in the res/drawable directory in my

21条回答
  •  清酒与你
    2020-11-22 04:40

    I like to use a simple script to flatten an organized directory structure provided by designers to something that can be used to generate an R file.

    Run with current path in drawable-hdpi:

    #! /bin/bash
    DIRS=`find * -type d`
    for dir in ${DIRS} ; do 
      for file in `ls ${dir}` ; do
        mv ${dir}/${file}  ${dir}_${file};
      done 
      rmdir ${dir};
    done
    

提交回复
热议问题