我正在尝试使用布局作为选择器,但是在膨胀视图时出现错误,并且应用程序在下面给出 ANR
org.xmlpull.v1.XmlPullParserException:二进制 XML 文件第 2 行:android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:877) 处的无效可绘制标签 LinearLayout
你有什么主意吗
谢谢
可绘制/selector_map_all.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@layout/map_atm_selected" android:state_selected="true" />
<item android:drawable="@layout/map_atm" />
</selector>
布局/map_atm.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aresource="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/List_color2"
android:gravity="center"
android:orientation="horizontal" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/ico_info" />
<TextView
style="@style/TextViewNormalOpac"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:text="Hepsi" />
</LinearLayout>
布局/map_atm_selected.xml
<? xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aresource="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/List_color2"
android:gravity="center"
android:orientation="horizontal" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/ico_info" />
<TextView
style="@style/TextViewNormalOpac"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:text="Hepsi" />
</LinearLayout>