Create a custom Drawable and use it in XML

后端 未结 3 534
傲寒
傲寒 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:13

    Starting Android API 24, custom Drawables classes can be used in XML only within your package.

    Custom drawables classes may be used in XML in multiple ways:

    Using the fully-qualified class name as the XML element name. For this method, the custom drawable class must be a public top-level class.

    
    

    Using drawable as the XML element name and specifying the fully-qualified class name from the class attribute. This method may be used for both public top-level classes and public static inner classes.

    
    

    Note: that is not supported by support library.

提交回复
热议问题