2016-05-09 11 views
-4

Cannot resolve symbol '@id/myLabel'」というエラーが表示されます。 同じエラーは、次の要素のためです:Android「シンボル '@ id/myLabelを解決できません」

"Cannot resolve symbol '@id/numberStudents'" 
"Cannot resolve symbol '@id/accept'" 

は、この問題を解決するために私を助けてください。 私のXMLのサンプルが下に貼り付けられています。

ありがとう、 Abhilash Kadala。

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent"> 
    <TextView 
     android:id="@+id/myLabel" 
     android:text="Name of student:" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
    /> 
    <EditText 
     android:id="@+id/numberStudents" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:layout_below="@id/myLabel" 
    /> 
    <Button 
     android:id="@+id/accept" 
     android:text="Accept" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_below="@id/numberStudents" 
     android:layout_alignParentRight="true" 
     android:layout_marginLeft="10px" 
    /> 
    <Button 
     android:id="@+id/cancel" 
     android:text="Cancel" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_toLeftOf="@id/accept" 
     android:layout_alignTop="@id/accept" 
    /> 

</RelativeLayout> 
+0

プロジェクトをクリーンアップしてください。 –

+1

クリーンまたはリビルドが行います。 –

+1

'android:layout_below =" @ id/myLabel "をアンドロイド:layout_below =" @ + id/myLabel "に変更し、他のすべてと同じようにします。 –

答えて

0

あなたはこの@+id/acceptのようにIDを宣言し、この@id/acceptなどの別の場所を使用するためです。

+0

簡単に答えを広げてみてください。 –

+0

ohkは@ + id/acceptと宣言しています。また、

関連する問題