今天写了一个selector的xml文件,有一个item准备用图片的结果使用了android:color。导致在代码中使用infalt()函数创建view时出错。改成android:drawable后成功!