我收到此錯誤的幫助:我需要在XML錯誤(新手)
錯誤:錯誤:No resource found that matches the given name (at 'text' with value '@string/_____').
我改變了字符串名稱很多時間,但我仍然得到它。我的代碼有什麼問題?它正在工作,但現在它不工作。
XML:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<LinearLayout
android:id="@+id/topLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<EditText
android:id="@+id/editTextMessage"
android:layout_width="fill_parent"
android:layout_height="100dp"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginTop="20dp"
android:ems="10"
android:hint="@string/message"
android:singleLine="false" >
</EditText>
<EditText
android:id="@+id/editTextNumber"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:layout_below="@+id/editTextMessage"
android:ems="10"
android:inputType="phone" >
</EditText>
<Button
android:id="@+id/buttonContact"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/editTextNumber"
android:layout_alignBottom="@+id/editTextNumber"
android:layout_alignParentRight="true"
android:text="@string/contact" />
<Button
android:id="@+id/buttonTimePickup"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/buttonContact"
android:layout_marginTop="40dp"
android:text="@string/time" /> <--- the error appears on this line
<Button
android:id="@+id/buttonDatePickup"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/buttonTimePickup"
android:layout_alignBottom="@+id/buttonTimePickup"
android:layout_alignParentRight="true"
android:layout_marginTop="40dp"
android:text="@string/date" /> <-- the error appears on this line
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/buttonDatePickup"
android:layout_marginTop="40dp"
android:text="@string/frequency" <--the error appears on this line
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="25sp" />
<RadioGroup
android:id="@+id/radioGroup"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_below="@+id/textView1"
android:layout_centerHorizontal="true"
android:layout_marginTop="20dp">
<RadioButton
android:id="@+id/oneTime"
android:layout_width="160dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/onetime" /> < error appears on this line
<RadioButton
android:id="@+id/fifteenMinutes"
android:layout_width="160dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/fifteen" /> <-- error appears on this line
<RadioButton
android:id="@+id/halfHour"
android:layout_width="160dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/halfhour" /> <-- error appears on this line
<RadioButton
android:id="@+id/hour"
android:layout_width="160dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/anhour" /> <-- error appears on this line
<RadioButton
android:id="@+id/halfDay"
android:layout_width="160dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/halfday" /> <-- error appears on this line
<RadioButton
android:id="@+id/daily"
android:layout_width="160dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/daily" /> <-- error appears on this line
<RadioButton
android:id="@+id/weekly"
android:layout_width="160dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/week" /> <-- error appears on this line
<RadioButton
android:id="@+id/monthly"
android:layout_width="160dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/month" /> <-- error appears on this line
<RadioButton
android:id="@+id/Yearly"
android:layout_width="160dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/year" /> <-- error appears on this line
</RadioGroup>
<Button
android:id="@+id/buttonConfirm"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_below="@+id/radioGroup"
android:layout_marginTop="40dp"
android:text="@string/confirm" /> <-- error appears on this line
</RelativeLayout>
</LinearLayout>
</ScrollView>
我卡在這一個。
如果你已經確認你的'strings.xml'中有正確的值,那麼[嘗試清理你的項目](http://stackoverflow.com/questions/17371281/element-type-button-must-be-隨後逐任一屬性的規範 - 鄰/ 17371305#17371305) – codeMagic