属性缺少了Android命名空间$ P $的工具PFIX:上下文 [英] Attribute is missing the Android namespace prefix for tools:context

查看:354
本文介绍了属性缺少了Android命名空间$ P $的工具PFIX:上下文的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Eclipse编辑器提供了属性缺少的Andr​​oid命名空间preFIX错误以下XML:

 < LinearLayout中的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
    机器人:layout_width =FILL_PARENT
    机器人:layout_height =FILL_PARENT
    机器人:方向=垂直
    工具:上下文=MainMenuActivity。>


解决方案

这是因为的xmlns:工具=htt​​p://schemas.android.com/tool​​s不见了。在code应该是这样的:

 < LinearLayout中的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
    的xmlns:工具=htt​​p://schemas.android.com/tool​​s
    机器人:layout_width =FILL_PARENT
    机器人:layout_height =FILL_PARENT
    机器人:方向=垂直
    工具:上下文=MainMenuActivity。>

Eclipse editor gives "Attribute is missing the Android namespace prefix" error for the following XML:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical"
    tools:context=".MainMenuActivity" >

解决方案

It is because xmlns:tools="http://schemas.android.com/tools" is missing. The code should look like this:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical"
    tools:context=".MainMenuActivity" >

这篇关于属性缺少了Android命名空间$ P $的工具PFIX:上下文的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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