Element type "LinearLayout" must be followed by either attribute specifications, ">" or "/>"的解决办法
看老师的word文档开始学习。复制了一段代码,在layout中新建了一个Android XML file,发现有提示错误。
代码如下:
<?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="match_parent"
android:orientation="vertical" >
<TextView android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello, I am a TextView" />
<Button android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello, I am a Button" />
</LinearLayout>
错误的提示是这样的:Element type "LinearLayout" must be followed by either attribute specifications, ">" or "/>".
在网上找了很久,都没有找到我理想的解决方案。这样几个小时就过去了。
后来自己无意间试了出来一种办法,居然可以消除这种错误。那就是右键点击这个xml文件,然后new -> Android XML flie -> finish。也就是新建一个相同名字的xml文件来覆盖这个文件。感觉内容是没有修改的,但是就是正确了。我的猜测是:word和eclipse的编码可能不同。但是具体是什么原因就不知道了。
Element type "LinearLayout" must be followed by either attribute specifications, ">" or "/>"的解决办法的更多相关文章
- Element type "bean" must be followed by either attribute specifications, ">" or "/>".
在这里其他内容就省了,错在,<bean id="bpcsU1gblDAO"class="dao.jk.bpcs.impl.BpcsU1gblDaoImpl" ...
- MVC中异常: An exception of type 'System.Data.ProviderIncompatibleException' occurred in EntityFramework.dll的一种解决办法
今天在调试MVC的例子的时候,总是出错(An exception of type 'System.Data.ProviderIncompatibleException' occurred in Ent ...
- java出现The type java.lang.Object cannot be resolved. It is indirectly referenced.....解决办法
当你在Eclipse引用不同版本JDK工程时会发生该问题.由于你开发环境中应用了多个版 本的JDK 或JRE导致的.Eclipse会按照最初的开发环境默认选择对应的Jre.如Eclipse上有jdk1 ...
- Multiple annotations found at this line: - The content of element type "mapper" must match "EMPTY". - Attribute "namespace" must be declared for element type "mapper".
今天在mybatis的mapper映射配置文件中遇到了这样的问题,困扰了我3个小时: Multiple annotations found at this line: - The content of ...
- The content of element type "configuration" must match "(properties?,settings?,typeAliases?,typeHandlers?,objectFactory?,objectWrapperFactory?,reflectorFactory?,plugins?,environments?,databaseIdProv
在mybatis配置文件config.xml中报错: The content of element type "configuration" must match "(p ...
- The content of element type "package" must match "(result-types?,interceptors?...
错误:“The content of element type "package" must match "(result-types?,interceptors?,de ...
- The content of element type "configuration" must match "(properties?,settings?,typeAliases?,typeHandlers?,objectFactory?...
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE configuration PUBLIC & ...
- Open quote is expected for attribute "property" associated with an element type "result".错误
java Mybatis 框架下的项目 报 Open quote is expected for attribute "property" associated with a ...
- web.xml配置bug之提示The content of element type "web-app" must match "(icon?,display- name?,description?,distributable?,
错误:配置web.xml时,出现红色叉叉,提示 The content of element type "web-app" must match "(icon?,disp ...
随机推荐
- Android StatusBarUtil:设置Android系统下方虚拟键键盘透明度
Android StatusBarUtil:设置Android系统下方虚拟键键盘透明度 Android StatusBarUtil是github上的一个开源项目,主页:https://githu ...
- ZOJ 1516 Uncle Tom's Inherited Land
题目大意: 除去那些作为荷塘的土地块,将剩余的土地希望每次将两块相邻的地一起卖出,最多能卖出多少种这样的由相邻土地 合成的长方形土地块 很明显的二分图问题,但是要考虑如何建模 一个长方形土地总是由相邻 ...
- Linux - 模块编程初试
计算机网络的课程设计要做防火墙,老师没有限制在什么系统上面做,所以决定在Linux上实现.找了一下相关的资料,发现其实Linux有提供Netfilter/Iptables,为用户提供防火墙的功能,稍微 ...
- 轰炸II
题目背景 本题为轰炸数据加强版 题目描述 一个城市遭到了M次轰炸,每次都炸了一个每条边都与边界平行的矩形 在轰炸后,有N个关键点,指挥官想知道,它们有没有受到过轰炸,如果有,被炸了几次,最后一次是第几 ...
- cordova windows环境配置
* 安装Cordova 1.cordova是利用nodeJS进行管理,所以要先下载nodeJS. 2. 打开命令窗口,输入:“npm install -g cordova”即可安装 3. 安装后,输入 ...
- 线段树专题 POJ3468 A Simple Problem with Integers
题意:n个点.m个操作.两种操作类型.C X Y K 表示区间[x,y]上每一个点值加k.Q X Y 求区间[x,y]的和 分析:线段树区间求和,裸模板 注意:结果会超int,要用long long ...
- 自己动手写reg注册表文件
自己动手写reg注册表文件 2015-01-12 20:23 1161人阅读 评论(1) 收藏 举报 分类: 玩转Windows应用层编程(12) 版权声明:本文为博主原创文章,未经博主允许不得转 ...
- android中ping命令的实现
/** * 推断Ping 网址是否返回成功 * * @param netAddress * @return */ public static String isPingSuccess(int pin ...
- Angular常用标记
(如果没有特别指明,则所有的HTML元素都支持该标记) (如果没有特别指明,则 AngularJS 指令不会覆盖原生js的指令) 1.数据绑定类: 1.插值语法:{{}} 2.标签内容绑定:ng-bi ...
- phonegap运行原理
用phonegap(现在名为cordova)来开发手机应用,给人的感觉,就是写了一些HTML5的网页,加上javascript,打包安装在手机上,然后就可以运行了,并且还能访问手机的各种功能和硬件,太 ...