android.content.res.Resources$NotFoundException: Resource is not a ColorStateList (color or path): T

来源:互联网 发布:天龙八部mac版 编辑:程序博客网 时间:2024/06/05 23:05

把Activity改为了AppCompatActivity后一运行就报错

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.okoer/com.okoer.core.activity.impl.SplashActivity}: android.content.res.Resources$NotFoundException: File res/drawable/abc_ic_ab_back_material.xml from drawable resource ID #0x7f020014Caused by: android.content.res.Resources$NotFoundException: File res/drawable/abc_ic_ab_back_material.xml from drawable resource ID #0x7f020014

把Activity改为了AppCompatActivity后一运行就报错,在stackOverFlow查了半天说在gradle增加如下配置:

 android {     defaultConfig {       vectorDrawables.useSupportLibrary = true      }   }

但是不好使,最后发现是Theme配置问题,之前全屏在manifest中配置了

android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen">

自定义一个style

    <style name="AppTheme.NoActionBar">    <item name="windowNoTitle">true</item>    <item name="windowActionBar">false</item>    <item name="android:windowFullscreen">true</item>    <item name="android:windowContentOverlay">@null</item></style>

关于Vectors:
http://blog.csdn.net/lyhhj/article/details/50735791
以后学习下

0 0
原创粉丝点击