# SelectorInjection [![](https://jitpack.io/v/tianzhijiexian/SelectorInjection.svg)](https://jitpack.io/#tianzhijiexian/SelectorInjection) ![](https://img.shields.io/badge/minSdk-16-blue.svg) [![](https://img.shields.io/github/stars/tianzhijiexian/SelectorInjection.svg)](https://github.com/tianzhijiexian/SelectorInjection) [![](https://img.shields.io/github/forks/tianzhijiexian/SelectorInjection.svg)](https://github.com/tianzhijiexian/SelectorInjection/network) 本项目提供了 Android 中按钮的 SVG (vectorDrawable) 支持,可以支持在 Android 5.0 以下使用 SVG 图片和 Tint 着色方案。 ### 依赖方式 1.添加JitPack仓库 ``` repositories { maven { url "https://jitpack.io" } } ``` 2.添加依赖 > implementation 'com.github.tianzhijiexian:SelectorInjection:Latest [Latest release](https://github.com/tianzhijiexian/SelectorInjection/releases) (*click it*)' ### 属性介绍 原则上是将原本`android:`前缀变成`app:`就可以支持 SVG (vectorDrawable) 和 Tint 了,下面是自定义控件和其支持属性的介绍: **SelectorTextView:** ``` app:drawableLeft="@drawable/icon_facebook_svg" app:drawableLeftTint="@color/red" ``` 属性格式: - drawable(Top/Left/Right/Bottom) - drawable(Top/Left/Right/Bottom)Tint **SelectorImageButton:** ``` app:src="@drawable/icon_facebook_svg" android:tint="@color/orange" ``` **SelectorRadioButton:** ``` app:button="@drawable/icon_renren_svg" app:buttonTint="@color/red" ``` 注:对于单选按钮的SVG和Tint支持 ### 示例 | View | Explain | Attribute | | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | | SelectorTextView |
| app:drawableBottom="@drawable/icon_facebook_svg"