<菜单的xmlns:安卓= QUOT; HTTP://schemas.android.com/apk/res/android">< /菜单>出现在main.xml中 [英] <menu xmlns:android="http://schemas.android.com/apk/res/android"></menu> appears in main.xml

查看:1700
本文介绍了<菜单的xmlns:安卓= QUOT; HTTP://schemas.android.com/apk/res/android">< /菜单>出现在main.xml中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Eclipse中创建一个Android项目。在菜单目录中,我试图取代现有的main.xml的内容。但

 <菜单的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android>< /菜单>

一直显示为我的main.xml的非常底线,无论多少次,我将其删除。到底是怎么回事?有没有在Eclipse中某些类型的设置,我需要关闭。

和在Eclipse中出现这行旁边的错误消息:

是继根元素在文档中的标记必须很好地形成。

我要替换为下面的main.xml中:

 <?XML版本=1.0编码=UTF-8&GT?;
 < LinearLayout中的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
 机器人:方向=垂直
 机器人:layout_width =FILL_PARENT
 机器人:layout_height =FILL_PARENT>
 <的TextView
 机器人:layout_width =FILL_PARENT
 机器人:layout_height =WRAP_CONTENT
 机器人:文字=@字符串/你好/>
 <的TextView
 机器人:layout_width =WRAP_CONTENT
 机器人:layout_height =WRAP_CONTENT
 机器人:文字=@字符串/ txtSpace/>
 <的TextView
 机器人:layout_width =WRAP_CONTENT
 机器人:layout_height =WRAP_CONTENT
 机器人:文字=@字符串/ txtFirstNumber/>
 <的EditText
 安卓的inputType =numberDecimal
 机器人:ID =@ + ID / EditText01
 机器人:layout_width =FILL_PARENT
 机器人:layout_height =WRAP_CONTENT> < /&的EditText GT;
 <的TextView
 机器人:layout_width =WRAP_CONTENT
 机器人:layout_height =WRAP_CONTENT
 机器人:文字=@字符串/ txtSpace/>
 <的TextView
 机器人:layout_width =WRAP_CONTENT
 机器人:layout_height =WRAP_CONTENT
 机器人:文字=@字符串/ txtSecondNumber/>
 <按钮
 机器人:文字=正片叠底
 机器人:ID =@ + ID / Button01
 机器人:layout_width =FILL_PARENT
 机器人:layout_height =WRAP_CONTENT> < /按钮>
 < / LinearLayout中>


解决方案

我有这个问题为好。

检查您的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&quot;&GT;&LT; /菜单&gt;出现在main.xml中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆