Valid XML file gives “failed to parse” error in Android ADT

前端 未结 8 1587
执笔经年
执笔经年 2020-12-19 18:08

I have made a XML file:



           


        
8条回答
  •  爱一瞬间的悲伤
    2020-12-19 18:18

    I've had the same problem too, and there were no problems in Eclipse->Problems for me either.

    You might consider adding in a default state for the drawable (as practiced in this ImageButton example at the Android Developers website), shown in this modified version of your presented code:

    
    
    
      
    
    
    

    Otherwise, I would say (from something I've experienced just now in Eclipse) that you should push the app out to your phone or emulator anyway. In Eclipse, I'm staring at a "Failed to parse..." message in my Graphical Layout tab of the layout XML file I am having troubles with, but on my phone, I see the image exactly as it should be (responds perfectly to button presses and whatnot).

提交回复
热议问题