&LT;菜单的xmlns:安卓= QUOT; HTTP://schemas.android.com/apk/res/android"&GT;&LT; /菜单&gt;出现在main.xml中 [英] <menu xmlns:android="http://schemas.android.com/apk/res/android"></menu> appears in main.xml
问题描述
我想在Eclipse中创建一个Android项目。在菜单目录中,我试图取代现有的main.xml的内容。但
&LT;菜单的xmlns:机器人=http://schemas.android.com/apk/res/android&GT;&LT; /菜单&gt;
一直显示为我的main.xml的非常底线,无论多少次,我将其删除。到底是怎么回事?有没有在Eclipse中某些类型的设置,我需要关闭。
和在Eclipse中出现这行旁边的错误消息:
是继根元素在文档中的标记必须很好地形成。
我要替换为下面的main.xml中:
&LT;?XML版本=1.0编码=UTF-8&GT?;
&LT; LinearLayout中的xmlns:机器人=http://schemas.android.com/apk/res/android
机器人:方向=垂直
机器人:layout_width =FILL_PARENT
机器人:layout_height =FILL_PARENT&GT;
&LT;的TextView
机器人:layout_width =FILL_PARENT
机器人:layout_height =WRAP_CONTENT
机器人:文字=@字符串/你好/&GT;
&LT;的TextView
机器人:layout_width =WRAP_CONTENT
机器人:layout_height =WRAP_CONTENT
机器人:文字=@字符串/ txtSpace/&GT;
&LT;的TextView
机器人:layout_width =WRAP_CONTENT
机器人:layout_height =WRAP_CONTENT
机器人:文字=@字符串/ txtFirstNumber/&GT;
&LT;的EditText
安卓的inputType =numberDecimal
机器人:ID =@ + ID / EditText01
机器人:layout_width =FILL_PARENT
机器人:layout_height =WRAP_CONTENT&GT; &LT; /&的EditText GT;
&LT;的TextView
机器人:layout_width =WRAP_CONTENT
机器人:layout_height =WRAP_CONTENT
机器人:文字=@字符串/ txtSpace/&GT;
&LT;的TextView
机器人:layout_width =WRAP_CONTENT
机器人:layout_height =WRAP_CONTENT
机器人:文字=@字符串/ txtSecondNumber/&GT;
&LT;按钮
机器人:文字=正片叠底
机器人:ID =@ + ID / Button01
机器人:layout_width =FILL_PARENT
机器人:layout_height =WRAP_CONTENT&GT; &LT; /按钮&GT;
&LT; / LinearLayout中&GT;
我有这个问题为好。
检查您的Eclipse设置:
窗口 - > preferences - >爪哇 - >编辑 - >保存操作|在保存时执行所选操作
I am trying to create an Android project in Eclipse. In the menu directory, I am trying to replace the content of the existing main.xml. But
<menu xmlns:android="http://schemas.android.com/apk/res/android"></menu>
keeps appearing as the very bottom line of my main.xml no matter how many times I delete it. What is going on? Is there some type of setting in Eclipse that I need to turn off.
And an error message appears in Eclipse beside the line that says:
"The markup in the document following the root element must be well-formed."
I want to replace the main.xml with the following:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/txtSpace" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/txtFirstNumber" />
<EditText
android:inputType="numberDecimal"
android:id="@+id/EditText01"
android:layout_width="fill_parent"
android:layout_height="wrap_content" > </EditText>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/txtSpace" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/txtSecondNumber" />
<Button
android:text="Multiply"
android:id="@+id/Button01"
android:layout_width="fill_parent"
android:layout_height="wrap_content"> </Button>
</LinearLayout>
I had that problem as well.
Check your Eclipse settings in:
Window -> Preferences -> Java -> Editor -> Save Actions | Perform the selected actions on save
这篇关于&LT;菜单的xmlns:安卓= QUOT; HTTP://schemas.android.com/apk/res/android"&GT;&LT; /菜单&gt;出现在main.xml中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!