Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jsf-2/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何修复错误:解析XML时出错:未绑定前缀_Android_Xml - Fatal编程技术网

Android 如何修复错误:解析XML时出错:未绑定前缀

Android 如何修复错误:解析XML时出错:未绑定前缀,android,xml,Android,Xml,我正在编写一个由从下载的库组成的应用程序,我收到一个名为“错误解析XML:Unbound prefix”的错误。如何修复此错误,这是我的XML,请解决它 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads" xmlns:tools=

我正在编写一个由从下载的库组成的应用程序,我收到一个名为“错误解析XML:Unbound prefix”的错误。如何修复此错误,这是我的XML,请解决它

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
         xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent" >
          <com.gc.materialdesign.views.ScrollView
            android:layout_width="fill_parent"
            android:layout_height="fill_parent">


        <com.gc.materialdesign.views.ButtonRectangle
                    android:id="@+id/button"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_centerInParent="true"
                    android:background="#1E88E5"
                    android:text="Button" />
    <RelativeLayout
                android:layout_width="fill_parent"
                android:layout_height="32dp"
                android:layout_marginLeft="24dp" >

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_centerVertical="true"
                    android:text="Float Button" />

                <View
                    android:layout_width="fill_parent"
                    android:layout_height="1dp"
                    android:layout_alignParentBottom="true"
                    android:background="#1E88E5" />



    </RelativeLayout>
        </com.gc.materialdesign.views.ScrollView>
  <!-- Error Occurred Here -->         <com.gc.materialdesign.views.ButtonFloat
                    android:id="@+id/buttonFloat"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentRight="true"
                    android:layout_alignParentBottom="true"
                    android:layout_marginRight="24dp"
                    android:background="#1E88E5"
                    materialdesign:animate="true"
                    materialdesign:iconDrawable="@drawable/pencil" />


    </RelativeLayout>

我认为你应该更换

  <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
        xmlns:tools="http://schemas.android.com/tools">



来源:

在父级相对布局中添加此行


xmlns:app=”http://schemas.android.com/apk/res-auto

我已经玩过这个把戏了,伙计,但是没有用@RobinHoodadd这个xmlns:app=“”&尝试使用线性布局并重新启动你的app谢谢你,伙计,通过放置xmlns:materialdesign=“”xmlns:tools=“”@iRuth,效果很好
  <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:materialdesign="http://schemas.android.com/apk/res-auto"
        xmlns:tools="http://schemas.android.com/tools">