2013-02-18 56 views
0

您好我正在做一個mapOverLay教程在線,我得到一個錯誤在我的XML。在LinearLayout標籤中,我收到錯誤「爲標籤LinearLayout發現的意外命名空間前綴xmlns」我試圖將其刪除,但那不起作用。任何想法問題可能是什麼?LinearLayout XML錯誤

<?xml version="1.0" encoding="utf-8"?> 
    <FrameLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent"> 

     <view android:id="@+id/mv" 
      class="com.google.android.maps.MapView" 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" 
      android:layout_weight="1" 
      android:clickable="true" 
      android:apiKey="07WVUg-srWUY6iEC2qTEiuT1mKYkoo6EVPK74pA" 
      /> 

      <!-- Must replace apiKey above with appropriate one for your development machine --> 

     <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
      android:orientation="horizontal" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:padding="0px"   
      > 

     <Button android:id="@+id/doOverlay" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:layout_marginLeft="30px" 
      android:layout_weight="1.0" 
      android:textSize="12sp" 
      android:text="@string/overlay_label" /> 

     <Button android:id="@+id/doAccess" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:layout_weight="1.0" 
      android:textSize="12sp" 
      android:text="@string/access_label" /> 

     <Button android:id="@+id/doRoute" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:layout_marginRight="30px" 
      android:layout_weight="1.0" 
      android:textSize="12sp" 
      android:text="@string/route_label" /> 

     </LinearLayout> 

    </FrameLayout> 
+2

使用的命名空間屬性僅在根標記,以便去除 「的xmlns:機器人=」 http://schemas.android.com/apk/ res/android「屬性..它可能會這樣工作 – Cata 2013-02-18 17:58:21

+0

是的工作表示感謝! – Marklar 2013-02-18 18:04:12

+1

不客氣:) ..只是接受作爲回答Pragnani的答案..這是同樣的事情,因爲我說,它可能會幫助其他人太.. – Cata 2013-02-18 18:11:48

回答

4

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
       android:orientation="horizontal" 
       android:layout_width="fill_parent" 
       android:layout_height="wrap_content" 
       android:padding="0px"   
       > 

刪除xmlns:android="http://schemas.android.com/apk/res/android