我的android项目中的XML文件出错
这是我的第一个android项目,我无法调试这个培训应用程序 当我为运行调试它时,我看到: XML文件中出错:中止生成 (对于android:hint=“@string/edit_message”/>)我的android项目中的XML文件出错,android,Android,这是我的第一个android项目,我无法调试这个培训应用程序 当我为运行调试它时,我看到: XML文件中出错:中止生成 (对于android:hint=“@string/edit_message”/>) 您没有关闭和标记。甚至StackOverflow语法Highlighting也表明了这一点。试试这个: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://
您没有关闭
和
标记。甚至StackOverflow语法Highlighting也表明了这一点。试试这个:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<EditText android:id="@+id/edit_message"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:hint="@string/edit_message" />
<Button
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button_send" />
</LinearLayout>
是否有名为“编辑消息”的字符串
如果是,为什么在代码中不使用此“>”关闭第一个“LinearLayout”您是否在strings.xml中创建了一个名为edit_message的字符串?您还缺少按钮末尾的/>
。此外,您应该在strings.xml中定义一个名为edit_message
的字符串。您可以在此页面找到完整的布局:。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<EditText android:id="@+id/edit_message"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:hint="@string/edit_message" />
<Button
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/button_send" />
</LinearLayout>