0
我想使用佈局選擇,但有一個錯誤上增加觀看和應用給 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>
你的選擇器是否叫做ico_info.xml?你有沒有嘗試清潔項目? – Desert
icoinfo是一個PNG文件,我清理了這個項目,但沒有任何改變,謝謝 – Talha
那麼你的選擇器的名字是什麼? – Desert