【发布时间】:2016-06-28 18:38:11
【问题描述】:
我将选择器用于复选框,它可以工作,但它会导致棒棒糖前版本出现问题
<selector xmlns:android="...">
<item android:state_checked="true"
android:drawable="@drawable/checked_icon" />
<item android:drawable="@drawable/icon" />
</selector>
<CheckBox
android:button="@drawable/terms_checkbox"/>
导致resourceNotFoundexception,如何解决,有什么解决办法吗?
致命异常:主要 android.view.InflateException: Binary XML file line #70: Error inflating class CheckBox
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.content.res.Resources$NotFoundException: File res/drawable/terms_service1.xml from drawable resource ID #0x7f020121
at android.content.res.Resources.loadDrawable(Resources.java:2096)
at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
at android.widget.CompoundButton.<init>(CompoundButton.java:74)
at android.widget.CheckBox.<init>(CheckBox.java:68)
Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #1: invalid drawable tag vector
at android.graphics.drawable.Drawable.createFromXmlInner(Draw
【问题讨论】:
-
适用于 Android 4.3 版。
-
我正在模拟器 android 版本 4.3.1 android.content.res.Resources$NotFoundException 上进行测试:
-
gradle中使用的buildToolsVersion是什么??
-
buildToolsVersion "23.0.3" 编译 'com.android.support:appcompat-v7:23.4.0'
-
同时设置vectorDrawables.useSupportLibrary = true
标签: android svg android-vectordrawable