2012-02-11 64 views
0

我正在做记事本的例子,我在notes_row.xml中有记事本1练习中的这个错误 我有这个编码,我仍然有这个问题。我不知道解决方案PLZ帮助我。安卓应用开发

<?xml version="1.0" encoding="utf-8"?> 

<TextView android:id="@+id/text1" 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" />` 

错误:错误解析XML:没有很好地形成(标记无效)

+1

删除/>后的字符(在layout_height属性的末尾)。 – Squonk 2012-02-11 06:42:43

回答

0
1) It is better to have component inside some layout. 
2) /> after this there is special character, why? remove that. 
+0

在一些布局中有一个组件是强制的吗?现在的方式,可能是他想为ListView创建一个row.xml。 – 2012-02-11 06:40:49

+0

以获得更好的格式,甚至对于row.xml也有内部布局。但我明白你在说什么。让我在我的答案中改变措词。 – kosa 2012-02-11 06:42:47

+0

@thinksteep:这是一个列表项目布局,所以可以自己拥有'TextView'。但是,您的第二点是正确的。 – Squonk 2012-02-11 06:44:06

0

有一个尾随'在文件的结尾的/>右 - 删除。