在Android的观点,错误的解析XML产生频繁的问题:未绑定preFIX [英] frequent issues arising in android view, Error parsing XML: unbound prefix

查看:122
本文介绍了在Android的观点,错误的解析XML产生频繁的问题:未绑定preFIX的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在android的观点常见的问题,错误解析XML:未绑定preFIX 2号线

 < XML版本=1.0编码=UTF-8&GT?;
<的LinearLayout机器人:方向=垂直机器人:ID =@ + ID / myScrollLayout
机器人:layout_width =FILL_PARENT机器人:layout_height =WRAP_CONTENT>
    < TextView的Andr​​oid版本:layout_height =WRAP_CONTENT机器人:layout_width =FILL_PARENT
    机器人:文本=家族机器人:ID =@ + ID /家庭
    机器人:TEXTSIZE =16px的机器人:填充=5像素
    机器人:TEXTSTYLE =黑体安卓重力=center_horizo​​ntal>
    < / TextView的>

    <滚动型的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
        机器人:layout_width =FILL_PARENT机器人:layout_height =WRAP_CONTENT
        机器人:方向=垂直的Andr​​oid:滚动条=垂直>
        <的LinearLayout机器人:方向=垂直机器人:ID =@ + ID / myMainLayout
        机器人:layout_width =FILL_PARENT机器人:layout_height =WRAP_CONTENT>
        < / LinearLayout中>
    < /滚动型>

< / LinearLayout中>
 

解决方案

有几个原因,这可能发生:

1)你看这个错误与不正确的命名空间,或属性的错字。像的xmlns是错误的,应该是的xmlns:机器人

2)第一个节点需要包括: 的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android

3)如果整合AdMob的检查自定义参数,如广告:adSize,需要

的xmlns:广告=htt​​p://schemas.android.com/apk/lib/com.google.ads

4)如果你正在使用LinerLayout可能需要定义工具

的xmlns:工具=htt​​p://schemas.android.com/tool​​s

I have frequent problem in android view, Error parsing XML: unbound prefix on Line 2.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:orientation="vertical" android:id="@+id/myScrollLayout" 
android:layout_width="fill_parent"  android:layout_height="wrap_content">
    <TextView android:layout_height="wrap_content" android:layout_width="fill_parent" 
    android:text="Family" android:id="@+id/Family" 
    android:textSize="16px" android:padding="5px" 
    android:textStyle="bold" android:gravity="center_horizontal">
    </TextView>

    <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent" android:layout_height="wrap_content"
        android:orientation="vertical" android:scrollbars="vertical">
        <LinearLayout android:orientation="vertical" android:id="@+id/myMainLayout" 
        android:layout_width="fill_parent"  android:layout_height="wrap_content">
        </LinearLayout>
    </ScrollView>

</LinearLayout>

解决方案

A couple of reasons that this can happen:

1) You see this error with an incorrect namespace, or a typo in the attribute. Like 'xmlns' is wrong, it should be xmlns:android

2) First node needs to contain: xmlns:android="http://schemas.android.com/apk/res/android"

3) If you are integrating AdMob check custom parameters like ads:adSize, you need

xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"

4) If you are using LinerLayout you might have to define tools

xmlns:tools="http://schemas.android.com/tools"

这篇关于在Android的观点,错误的解析XML产生频繁的问题:未绑定preFIX的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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