我有一个恼人的问题.我在我的Android项目中使用Fragment,这让我感到无尽的痛苦,因为我每次编辑主xml文件时都必须清理项目.这是它的样子:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<fragment xmlns:map="http://schemas.android.com/apk/res-auto"
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
class="com.google.android.gms.maps.MapFragment"
map:uiRotateGestures="false"
map:uiScrollGestures="false"
map:uiZoomControls="false"
map:uiZoomGestures="false"
map:cameraZoom="18"
/>
<ScrollView
android:id="@+id/scroller"
android:layout_width="250dp"
android:layout_height="100dp"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:background="@android:color/white">
<TextView
android:id="@+id/debug_text"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:textSize="10sp"
/>
</ScrollView>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
如果我甚至编辑该文件的一个字符,则以"map"开头的所有行都会以红色突出显示,并且片段开始标记也会突出显示.我得到的错误是:
Unexpected namespace prefix "xmlns" found for tag fragment
Run Code Online (Sandbox Code Playgroud)
对于以"map"开头的行,错误是:
Unexpected namespace prefix "map" found for tag fragment
Run Code Online (Sandbox Code Playgroud)
如果我清理项目问题就会消失,我可以很好地构建和运行项目,但是由于我现在正在编辑它很多,所以它非常烦人.有人可以帮忙吗?
在Eclipse中,您可以自动转到Project - > build,其中应该包含一个干净的进程.您还可以使用adb构建ANT脚本,并使用build.xml文件将清理目标设置为构建的一部分.
归档时间: |
|
查看次数: |
835 次 |
最近记录: |