天青晚雨 2015-05-02 14:49 采纳率: 66.7%
浏览 4916
已采纳

android studio报错XML:not well-formed

< RelativeLayout 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:background= "@drawable/baidi" >

< ImageView
    android:id ="@+id/login_button"
    android:layout_width ="wrap_content"
    android:layout_height ="wrap_content"
    android:layout_centerHorizontal ="true"
    android:layout_marginTop ="50dp"
    android:src ="@drawable/yezizhi" />

<!--整体边框块的颜色 -->
<LinearLayout
    android:id ="@+id/input"
    android:layout_width ="fill_parent"
    android:layout_height ="wrap_content"
    android:layout_below ="@id/login_button"
    android:layout_marginLeft ="28.0dip"
    android:layout_marginRight ="28.0dip"
    android:background ="@drawable/baidi"
    android:orientation ="vertical" >

    <!--账号框颜色-->
    < LinearLayout
        android:layout_width ="fill_parent"
        android:layout_height ="44.0dip"
        android:background ="@drawable/baidi"
        android:gravity ="center_vertical"
        android:orientation ="horizontal" >

        < EditText
            android:id ="@+id/searchEditText"
            android:layout_width ="0dp"
            android:layout_height ="fill_parent"
            android:layout_weight ="1"
            android:background ="@null"
            android:ems ="10"
            android:imeOptions ="actionDone"
            android:singleLine ="true"
            android:textSize ="16sp"
            android:hint="输入账户名"
            android:text="输入账户名">

            < requestFocus />
        </ EditText>
    </ LinearLayout>

    < View
        android:layout_width ="fill_parent"
        android:layout_height ="1.0px"
        android:layout_marginLeft ="1.0px"
        android:layout_marginRight ="1.0px"
        android:background ="#ffc0c3c4" />

    <!--隐形显示文字,点击消失-->
    < EditText
        android:id ="@+id/password"
        android:layout_width ="fill_parent"
        android:layout_height ="44.0dip"
        android:background ="#00ffffff"
        android:gravity ="center_vertical"
        android:inputType ="textPassword"
        android:maxLength ="16"
        android:maxLines ="1"
        android:textColor ="#ff1d1d1d"
        android:textColorHint ="#ff666666"
        android:textSize ="16.0sp"
        android:hint="密码"
        android:text="输入密码" />
</LinearLayout >

<Button
    android:id ="@+id/buton1"
    android:layout_width ="270dp"
    android:background ="@drawable/landi"
    android:paddingTop ="5.0dip"
    android:layout_height ="50dp"
    android:gravity ="center"
    android:textSize ="20dp"
    android:text = "登录"
    android:layout_alignBottom="@id/input"
    android:layout_centerHorizontal="true" />

</ RelativeLayout>

报错XML:not well-formed
错误地方在 android:layout_alignBottom="@id/input"
和 android:layout_below ="@id/login_button"

  • 写回答

2条回答 默认 最新

  • threenewbee 2015-05-02 15:16
    关注

    你很多xml元素开始都有一个空格,这是不规范的,应该去掉

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 lammps拉伸应力应变曲线分析
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
  • ¥30 python代码,帮调试,帮帮忙吧
  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建