Can the Android drawable directory contain subdirectories?

后端 未结 21 1232
醉梦人生
醉梦人生 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:50

    This is not perfect methods. You have to implement same way which is display here.

    You can also call the image under the folder through the code you can use

    Resources res = getResources();
    Drawable shape = res. getDrawable(R.drawable.gradient_box);
    
    TextView tv = (TextView)findViewByID(R.id.textview);
    tv.setBackground(shape);
    

提交回复
热议问题