2013-03-30 1 views
3

salut j'essaye de créer un dossier de xml qui inclut 1- étiquette 'tâche' et une vue de texte dessous pour l'entrée d'utilisateur 2 étiquette 'prix' et une vue de texte sous pour l'entrée de l'utilisateur 3 étiquettes «catégorie» et une combobox avec 6 choix 4- étiquette «date à fin» et un calendrier à côté de lui 5- étiquette «date à rappeler» et un calendrier à côté enfin un bouton pour sauver le problème est que je ne pouvais pas trouver combobox sur Eclipse, le deuxième calendrier et le bouton ne semblent pas voici le codeMauvais bloc xml 3 linearlayout et 2 calender

fichier xml

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical" > 
<!-- Name Label --> 
    <TextView android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:text="@string/tsk" 
     android:paddingLeft="10dip" 
     android:paddingRight="10dip" 
     android:paddingTop="10dip" 
     android:textSize="17dip"/> 

    <!-- Input Name --> 
    <EditText 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:layout_margin="5dip" 
     android:layout_marginBottom="15dip" 
     android:singleLine="true"/> 

     <!-- Price Label --> 
    <TextView android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:text="@string/price" 
     android:paddingLeft="10dip" 
     android:paddingRight="10dip" 
     android:paddingTop="10dip" 
     android:textSize="17dip"/> 

    <!-- Input Price --> 
    <EditText 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:layout_margin="5dip" 
     android:layout_marginBottom="15dip" 
     android:singleLine="true" 
     android:inputType="numberDecimal"/> 

    <!-- category Label --> 
    <TextView android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:text="@string/cat" 
     android:paddingLeft="10dip" 
     android:paddingRight="10dip" 
     android:paddingTop="10dip" 
     android:textSize="17dip"/> 

    <!-- Input category --> 

    <EditText 
     android:layout_width="fill_parent" 
     android:layout_height="32dp" 
     android:layout_margin="5dip" 
     android:layout_marginBottom="15dip" 
     android:gravity="top" 
     android:lines="4" /> 

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="horizontal" 
    android:paddingTop="4dip" 
    android:paddingBottom="6dip" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent"> 
    <TextView 
     android:layout_width="90dip" 
     android:layout_height="wrap_content" 
     android:layout_weight="0.00" 
     android:text="@string/de" /> 
    <Calender 
     android:layout_width="wrap_content" 
     android:layout_height="36dp" /> 
     </LinearLayout> 

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="horizontal" 
    android:paddingTop="4dip" 
    android:paddingBottom="6dip" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent"> 
    <TextView 
     android:layout_width="90dip" 
     android:layout_height="wrap_content" 
     android:layout_weight="0.00" 
     android:text="@string/de" /> 
    <Calender 
     android:layout_width="wrap_content" 
     android:layout_height="66dp" /> 
     </LinearLayout> 

<!-- Button Create task --> 
    <Button 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:text="@string/save"/> 

</LinearLayout> 

et il y a beaucoup d'erreur

[2013-03-30 21:46:01 - checklist] W/ResourceType(12304): Bad XML block: header size 301 or total size 0 is larger than data size 0 
[2013-03-30 21:46:01 - checklist] C:\Users\Najd\workspace\checklist\res\values\strings.xml:4: error: Found tag id where item is expected 
[2013-03-30 21:46:01 - checklist] C:\Users\Najd\workspace\checklist\res\layout\add_task.xml:7: error: Error: No resource found that matches the given name (at 'text' with value '@string/tsk'). 
[2013-03-30 21:46:01 - checklist] C:\Users\Najd\workspace\checklist\res\layout\add_task.xml:24: error: Error: No resource found that matches the given name (at 'text' with value '@string/price'). 
[2013-03-30 21:46:01 - checklist] C:\Users\Najd\workspace\checklist\res\layout\add_task.xml:42: error: Error: No resource found that matches the given name (at 'text' with value '@string/cat'). 
[2013-03-30 21:46:01 - checklist] C:\Users\Najd\workspace\checklist\res\layout\add_task.xml:67: error: Error: No resource found that matches the given name (at 'text' with value '@string/de'). 
[2013-03-30 21:46:01 - checklist] C:\Users\Najd\workspace\checklist\res\layout\add_task.xml:80: error: Error: No resource found that matches the given name (at 'text' with value '@string/save'). 
[2013-03-30 21:46:01 - checklist] C:\Users\Najd\workspace\checklist\res\menu\activity_main_task.xml:3: error: Error: No resource found that matches the given name (at 'title' with value '@string/menu_settings'). 

Répondre

0

Vous faites référence à des chaînes comme @string/save, @string/de etc., mais ils n'existent pas. Ajoutez-les à votre fichier strings.xml:

<string name="save">Save</string> 
+0

@Ahmed Je les ai déjà ajouté, mais j'utilisé des lettres arabes – Najd

+0

Ajoutez votre fichier strings.xml à votre question – Ahmad

+0

@Ahmed je l'ai ajouté – Najd

0

Je pense, vous avez fait une faute de frappe: string.xml devrait être renommé strings.xml

+0

Cela ne devrait pas jouer de rôle puisque les noms des fichiers de ressources n'ont pas besoin d'être appelés comme ça. C'est juste une convention. – Ahmad

0

je une mise en page linéaire, thats assez pour l'instant

<?xml version="1.0" encoding="utf-8"?> 
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:orientation="vertical" > 

    <!-- Name Label --> 


    <TextView 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:paddingLeft="10dip" 
     android:paddingRight="10dip" 
     android:paddingTop="10dip" 
     android:text="@string/tsk" 
     android:textSize="17dip" 
     android:gravity="right" /> 

    <!-- Input Name --> 

    <EditText 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:layout_margin="5dip" 
     android:layout_marginBottom="15dip" 
     android:singleLine="true" /> 

    <!-- Price Label --> 

    <TextView 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:paddingLeft="10dip" 
     android:paddingRight="10dip" 
     android:paddingTop="10dip" 
     android:text="@string/price" 
     android:textSize="17dip" 
     android:gravity="right"/> 

    <!-- Input Price --> 

    <EditText 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:layout_margin="5dip" 
     android:layout_marginBottom="15dip" 
     android:inputType="numberDecimal" 
     android:singleLine="true" /> 

    <!-- category Label --> 

    <TextView 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:paddingLeft="10dip" 
     android:paddingRight="10dip" 
     android:paddingTop="10dip" 
     android:text="@string/cat" 
     android:textSize="17dip" 
     android:gravity="right" /> 

    <!-- Input category --> 

    <EditText 
     android:layout_width="fill_parent" 
     android:layout_height="32dp" 
     android:layout_margin="5dip" 
     android:layout_marginBottom="15dip" 
     android:gravity="top" 
     android:lines="4" /> 

    <TextView 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:gravity="right" 
     android:text="@string/de" /> 

    <CalendarView 
     android:id="@+id/calendarView1" 
     android:layout_width="wrap_content" 
     android:layout_height="59dp" 
     android:gravity="right" /> 

    <TextView 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_weight="0.20" 
     android:gravity="right" 
     android:text="@string/dr" /> 

    <CalendarView 
     android:id="@+id/calendarView2" 
     android:layout_width="wrap_content" 
     android:layout_height="40dp" 
     android:layout_weight="0.39" 
     android:gravity="right" /> 

    <Button 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:text="@string/save" /> 

</LinearLayout>