不';Android Tint支持API级别19?
布局代码 按钮:不';Android Tint支持API级别19?,android,button,colors,tint,Android,Button,Colors,Tint,布局代码 按钮: <Button android:id="@+id/button1" style="@style/OneButton" android:layout_width="fill_parent" android:drawableLeft="@drawable/ic_setting" android:text="Setting"/> 可绘制的位图: ic_设置: <?xml version="1.0" encoding="utf-8"?>
<Button
android:id="@+id/button1"
style="@style/OneButton"
android:layout_width="fill_parent"
android:drawableLeft="@drawable/ic_setting"
android:text="Setting"/>
可绘制的位图:
ic_设置:
<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/ic_redeem"
android:tint="@color/red"/>
这在API级别21及以上的情况下运行良好。
使用Android 5.0(API级别21)及以上版本,您可以对位图和
定义为alpha遮罩的九个面片。你可以给它们上色
解析为颜色资源的资源或主题属性
AppCompat支持库提供了可用于支持棒棒糖前设备的API(主要是
DrawableCompat\35; wrap()
和DrawableCompat\setTintList()
)。查看更多信息。我们可以在低于API级别的情况下实现这一点吗21@Sujay我还没试过这个。你应该使用21
@Sujay我很确定支持库能完成它的工作。是的,先生@BobMalooga