佩奇在做项目的时候,遇到一个错误,查看好久都没有发现问题.然后在把句子拿去翻译才发现是丢失了引号.
上代码.
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:state_focused="true" android:state_pressed="false" android:drawable="@drawable/schedule_bg"></item>
<item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/schedule_selection"></item>
<item android:state_focused="false" android:state_pressed=true android:drawable="@drawable/schedule_selection"></item>
</selector>
在第三个item中的android:state_pressed=true中,丢失了引号.导致报错
Open quote is expected for attribute "android:state_pressed" associated with an element type "item".
佩奇还是希望大家在写代码的时候能够细心一点,即使报错了也要用心查看或者以一个旁人的角度去查看, 局中人是不难么容易找到答案的呢.