在Android的观点,错误的解析XML产生频繁的问题:未绑定preFIX [英] frequent issues arising in android view, Error parsing XML: unbound prefix
问题描述
我在android的观点常见的问题,错误解析XML:未绑定preFIX 2号线
< XML版本=1.0编码=UTF-8&GT?;
<的LinearLayout机器人:方向=垂直机器人:ID =@ + ID / myScrollLayout
机器人:layout_width =FILL_PARENT机器人:layout_height =WRAP_CONTENT>
< TextView的Android版本:layout_height =WRAP_CONTENT机器人:layout_width =FILL_PARENT
机器人:文本=家族机器人:ID =@ + ID /家庭
机器人:TEXTSIZE =16px的机器人:填充=5像素
机器人:TEXTSTYLE =黑体安卓重力=center_horizontal>
< / TextView的>
<滚动型的xmlns:机器人=http://schemas.android.com/apk/res/android
机器人:layout_width =FILL_PARENT机器人:layout_height =WRAP_CONTENT
机器人:方向=垂直的Android:滚动条=垂直>
<的LinearLayout机器人:方向=垂直机器人:ID =@ + ID / myMainLayout
机器人:layout_width =FILL_PARENT机器人:layout_height =WRAP_CONTENT>
< / LinearLayout中>
< /滚动型>
< / LinearLayout中>
有几个原因,这可能发生:
1)你看这个错误与不正确的命名空间,或属性的错字。像的xmlns是错误的,应该是的xmlns:机器人
2)第一个节点需要包括:
的xmlns:机器人=http://schemas.android.com/apk/res/android
3)如果整合AdMob的检查自定义参数,如广告:adSize,需要
的xmlns:广告=http://schemas.android.com/apk/lib/com.google.ads
4)如果你正在使用LinerLayout可能需要定义工具
的xmlns:工具=http://schemas.android.com/tools
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屋!