2011-06-16 59 views
0

我的環境是 蝕:3.2 安卓2.3錯誤main.xml中的文件:錯誤解析XML:綁定前綴

<?xml version="1.0" encoding="utf-8"?> 

<LinearLayout 
    android:id="@+id/linearLayout2" 
    android:layout_width="fill_parent" 
    android:isScrollContainer="true" 
    android:keepScreenOn="true" 
    android:layout_height="wrap_content" 
    android:orientation="vertical"> 
<TextView 
    android:text="The Company" 
    android:layout_height="wrap_content" 
    android:layout_weight="1" 
    style="@layout/main" 
    android:layout_width="wrap_content" 
    android:textSize="40dip" 
    android:id="@+id/textView1" 
    android:layout_gravity="center_horizontal" 
    android:paddingTop="30dip"></TextView> 
    <TextView 
    android:text="Shopping Lists" 
    android:layout_height="wrap_content" 
    android:layout_marginTop="40px" 
    android:layout_width="wrap_content" 
    android:textSize="25dip" 
    android:id="@+id/textView2" 
    android:layout_gravity="center_horizontal"></TextView> 
<FrameLayout 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_x="40px" 
     android:layout_y="35px"> 
<ScrollView 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/widget54" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent"> 

<ListView 
     android:id="@android:id/list" 
     android:orientation="vertical" 
     android:layout_width="wrap_content" 
     android:layout_weight="15.0" android:layout_height="fill_parent"/> 
     </ScrollView> 
     </FrameLayout> 
    <LinearLayout 
     android:layout_height="wrap_content" 
     android:id="@+id/linearLayout1" 
     android:layout_width="match_parent"> 
    <Button 
     android:text="New Project" 
     android:layout_height="wrap_content" 
     android:layout_width="wrap_content" 
     android:id="@+id/button1" 
     android:textColorHighlight="#ff0000"> 
     </Button> 
     <Button 
     android:text="Manage Projects" 
     android:layout_height="wrap_content" 
     android:layout_width="wrap_content" 
     android:id="@+id/button2"> 
     </Button> 
     <Button 
     android:text="Done" 
     android:layout_height="wrap_content" 
     android:layout_width="wrap_content" 
     android:id="@+id/button3"> 
     </Button> 
    </LinearLayout> 
</LinearLayout> 
+0

把你的xml完全 – ngesh 2011-06-16 12:46:02

回答

0

每個xml文件都需要有一個名稱空間,它使用xmlns在xml文件的根標記中定義。因此,woodshy的建議正是您需要的,請在您的xml文件的第一個LinearLayout中添加:xmlns:android="http://schemas.android.com/apk/res/android

1

添加的xmlns:安卓=「http://schemas.android.com/ apk/res/android「爲根LinearLayout

相關問題