Create a custom Drawable and use it in XML

后端 未结 3 575
傲寒
傲寒 2020-12-30 00:30

I am busy creating a less complicated version of NinePatchDrawable that tiles the inner panels instead of stretching them.

I can implement the actual lo

3条回答
  •  既然无缘
    2020-12-30 01:29

    Unfortunately it is not possible to use custom drawables in XML files (for API 23 and below) due to potential security issues. See here for a Google Groups thread about this very topic with a response from Romain Guy, one of the Android developers.

    You can still use them in your Java code though.

    Update:

    As LeoFarage points out in the comments, starting in API 24 you can now use custom drawables in XML files but only within your application package.

提交回复
热议问题