LinearLayout XML错误
问题描述:
您好我正在做一个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>
答
在
<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
使用的命名空间属性仅在根标记,以便去除 “的xmlns:机器人=” http://schemas.android.com/apk/ res/android“属性..它可能会这样工作 – Cata 2013-02-18 17:58:21
是的工作表示感谢! – Marklar 2013-02-18 18:04:12
不客气:) ..只是接受作为回答Pragnani的答案..这是同样的事情,因为我说,它可能会帮助其他人太.. – Cata 2013-02-18 18:11:48