Xamarin - binary line of XML file # 1: error inflating class <unknown>
I am currently developing a small Android application in Xamarin using C #.
When I start the emulator, the following appears on my emulator:
This line of code is called when the first tab is selected, which by default means that this error occurs as soon as I start the program. The XML snippet that seems to be causing the error is that in one of my layout files:
android:background="@color/done"
111 Dialer.axml, . , , . , , button, . done.xml color:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true" android:color="#ff2222ff"/>
<item android:state_pressed="true" android:state_enabled="false" android:color="#ff4444ff"/>
<item android:state_enabled="false" android:color="#ff000000"/>
<item android:color="#ff0000ff"/>
</selector>
Dialer.axml:
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:minWidth="25px"
android:minHeight="25px"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/tableLayout1"
android:background="#2ec0ff">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="50sp"
android:layout_marginBottom="40sp"
android:id="@+id/number"
android:editable="false"
android:singleLine="true"
android:scrollHorizontally="true"
android:gravity="right"
android:textColor="#fff" />
<TableRow
android:id="@+id/tableRow1"
android:layout_weight="1">
<Button
android:text="1"
android:layout_column="0"
android:id="@+id/button1"
android:layout_weight="1"
android:layout_height="match_parent" />
<Button
android:text="2"
android:layout_column="1"
android:id="@+id/button2"
android:layout_weight="1"
android:layout_height="match_parent" />
<Button
android:text="3"
android:layout_column="2"
android:id="@+id/button3"
android:layout_weight="1"
android:layout_height="match_parent" />
</TableRow>
<TableRow
android:id="@+id/tableRow2"
android:layout_weight="1">
<Button
android:text="4"
android:layout_column="0"
android:id="@+id/button4"
android:layout_weight="1"
android:layout_height="match_parent" />
<Button
android:text="5"
android:layout_column="1"
android:id="@+id/button5"
android:layout_weight="1"
android:layout_height="match_parent" />
<Button
android:text="6"
android:layout_column="2"
android:id="@+id/button6"
android:layout_weight="1"
android:layout_height="match_parent" />
</TableRow>
<TableRow
android:id="@+id/tableRow3"
android:layout_weight="1">
<Button
android:text="7"
android:layout_column="0"
android:id="@+id/button7"
android:layout_weight="1"
android:layout_height="match_parent" />
<Button
android:text="8"
android:layout_column="1"
android:id="@+id/button8"
android:layout_weight="1"
android:layout_height="match_parent" />
<Button
android:text="9"
android:layout_column="2"
android:id="@+id/button9"
android:layout_weight="1"
android:layout_height="match_parent" />
</TableRow>
<TableRow
android:id="@+id/tableRow4"
android:layout_weight="1">
<Button
android:text="*"
android:layout_column="0"
android:id="@+id/buttonStar"
android:layout_weight="1"
android:layout_height="match_parent" />
<Button
android:text="0"
android:layout_column="1"
android:id="@+id/button0"
android:layout_weight="1"
android:layout_height="match_parent" />
<Button
android:text="#"
android:layout_column="2"
android:id="@+id/buttonPound"
android:layout_weight="1"
android:layout_height="match_parent" />
</TableRow>
<Button
android:text="Done"
android:id="@+id/buttonDone"
android:background="@color/done"
android:layout_width="match_parent"
android:layout_height="80sp"
android:textSize="35sp"
android:layout_margin="5sp" />
</TableLayout>
? done.xml? ?
.
+1
1
done.xml - , . .
:
<?xml version="1.0" encoding="UTF-8" ?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true">
<shape android:shape="rectangle">
<solid android:color="#ff2222ff" />
</shape>
</item>
<item android:state_pressed="true" android:state_enabled="false">
<shape android:shape="rectangle">
<solid android:color="#ff4444ff" />
</shape>
</item>
<item android:state_enabled="false">
<shape android:shape="rectangle">
<solid android:color="#ff000000" />
</shape>
</item>
<item>
<shape android:shape="rectangle">
<solid android:color="#ff0000ff" />
</shape>
</item>
</selector>
xml xml :
android:background="@drawable/done"
: ?
+2