I'm trying to set a tabhost selector, as i found an example demonstrating that i should create an xml file in drawable like this :
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/hotel_selected"
android:state_selected="true" />
<item android:drawable="@drawable/hotel" /开发者_StackOverflow社区>
</selector>
but when compiling, eclipse keep saying that it's an invalid start tag in this file.
please help me solve this.
many thanks.
Found a solution, I created the xml file by using a simple text editor (notepad++) and saved it to /res/drawable
and compiled, result: it worked like a charm :)
Ideal solution should be to put the XML file in
/res/xml
i have came across the same error and than solved, i did mistake of adding the xml file under values folder so it was not able to recognise selector tag. i removed it from values folder and added inside the drawable folder and it worked without any error. this was in case of Xamarin.Android.
You can right click on the directory you want to create the XML file, selecect Android xml file, and then edit that file. This solved my issue.
Its seems that there is no any error.
There may be some problem. But you can do one thing, do Project -> Clean , it may resolve your issue.
精彩评论