Android类型错误:解析XML时出错:格式不正确(无效标记)
我对android/java很新颖,并且一直在关注一些YouTube教程,并且在我的一个xml布局中遇到了一个严重问题。Android类型错误:解析XML时出错:格式不正确(无效标记)
基本上,我在EditText
部分中的代码的android:hint
上发生'错误解析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="wrap_content"
android:orientation="vertical"
android:padding="25dp" >
<EditText
android:id="@+id/etCommands"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="@string/Type a command"
android:inputType="true">
</EditText>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="100" >
<Button
android:id="@+id/bResults"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="20"
android:text="@string/Try Command" >
</Button>
<ToggleButton
android:id="@+id/tbPassword"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="80"
android:checked="true"
android:paddingBottom="3dp"
android:text="@string/ToggleButton" />
</LinearLayout>
<TextView
android:id="@+id/tvResults"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/Invalid"
</TextView>
</LinearLayout>
<TextView
android:id="@+id/tvResults"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/Invalid"> <--- you forgot to close bracket here
^^^
</TextView>
而在你EditText
要设置提示您string.xml
而且可以肯定是没有问题的你string.xml
<EditText
android:id="@+id/etCommands"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="SOME HINT" <---- Just try this testing purpose only
android:inputType="true">
</EditText>
感谢您的球员的支架。我已经关闭了文本视图,但仍然存在我的问题。我现在有一个问题,与我的其他类错误'R无法解决' – user1352057 2012-08-06 15:18:19
因为这看到这个答案http://stackoverflow.com/a/11467781/1289716 – MAC 2012-08-06 15:24:30
关闭TextView的 – Dharmendra 2012-08-06 13:31:44