zoukankan      html  css  js  c++  java
  • Android 编译错误——布局 Error parsing XML: not well-formed (invalid token)

    在修改了Android布局文件后,编译出现Error parsing XML: not well-formed (invalid token)。

    首先先排查xml文件的编码格式是否为UTF-8, <?xml version="1.0" encoding="utf-8"?> ,注意,从别处copy的要留意编码格式!

    还有各个标签是否有遗漏,把鼠标箭头移到出错误的layout上 点击鼠标右键选择Source然后再选Format。

    都没有问题,结果发现报错处(第9行):

     1 <TextView
     2 
     3      android:id="@+id/TetxView1"
     4 
     5      android:layout_width="wrap_content"
     6 
     7      android:layout_height=“wrap_content”
     8 
     9      android:text=">31"
    10 
    11      android:textSize="@dimen/text_size"
    12 
    13      android:textColor="@color/text_color"
    14 
    15    />

    在控件属性值里包含“>”或“<”,就会出错,建议在代码中赋值!

  • 相关阅读:
    HDU 1159 Common Subsequence 动态规划
    poj2349 Arctic Network
    hdu1596 find the safest road
    poj 1011
    二进制枚举
    codeforces 626E Simple Skewness
    code for 1
    painting fence
    codeforces 797c minimal string
    POJ 3977
  • 原文地址:https://www.cnblogs.com/ghimtim/p/6947396.html
Copyright © 2011-2022 走看看