2014-02-25 39 views
0

发现我有这个错误在我的XML没有资源在XML

错误:错误:没有资源发现在给定的名称(具有值“@阵列/ Tipo_peso”在“^ index_0”)相匹配。

<?xml version="1.0" encoding="utf-8"?> 
    <resources> 
<string-array name="@string/array_tipo_conversion"> 
     <item>@array/Tipo_peso</item> //here show the error 
     <item>@array/Tipo_Longitud</item> 
     <item>@array/Tipo_Volumen</item> 
    </string-array> 

    <string-array name="@string/tipos"> 
     <item>Peso</item> 
     <item>Longitud</item> 
     <item>Volumen</item> 
    </string-array> 

    <string-array name="@string/Tipo_peso"> 
    <item>Kg</item> 
    <item>Gramos</item> 
    <item>Onza</item> 
    <item>Libras</item> 
    <item>Toneladas</item> 
</string-array> 

这是

<string name="Tipo_Volumen">Tipo_Volumen</string> 
    <string name="Tipo_Longitud">Tipo_Logitud</string> 
    <string name="Tipo_peso">Tipo_peso</string> 
     <string name="tipos">tipos</string> 
     <string name="array_tipo_conversion">array_tipo_conversion</string> 

我需要用英语和西班牙语

+0

其他人正在工作? – Si8

回答

0

不能使用“标识”作为属性值的名字翻译这个的strings.xml文件“在下面一行:

<string-array name="@string/Tipo_peso"> 

考虑一下:

<string-array name="Tipo_peso"> 
+0

但我需要用英语和西班牙语翻译 – Gatiko06

+0

请记住,字符串数组中的属性'name'与实际数组本身无关。它只是用来指代你的代码中的数组。要拥有本地化的应用,您必须在“res”文件夹中创建不同的文件夹,然后为要包含在应用中的每种语言创建一个单独的文件夹。在所有这些xml文件中,属性'name'应该保持不变。有关更多信息,请参阅http://developer.android.com/guide/topics/resources/localization.html –