首页 > 代码库 > Unexpected namespace prefix "custom" found for tag

Unexpected namespace prefix "custom" found for tag

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              xmlns:custom="http://schemas.android.com/apk/res-auto"
              xmlns:tools="http://schemas.android.com/tools"
              android:orientation="vertical"
              android:layout_width="match_parent"
              android:layout_height="match_parent">
    <fragment
        class="com.demo.artshell.fragmentdemo.ExampleFragment"
        android:id="@+id/example_fragment"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        custom:label="@string/example_fragment_arguments"
        tools:ignore="MissingPrefix"/>
</LinearLayout>

 添加:

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

解决这个警告信息!

以上是在AS工具中出现的问题:

另外一篇文章是在eclipse上使用出现的问题:解决方法

Unexpected namespace prefix "custom" found for tag