Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/202.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/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 main.xml文件中出错:分析xml时出错:未绑定前缀_Android - Fatal编程技术网

Android main.xml文件中出错:分析xml时出错:未绑定前缀

Android main.xml文件中出错:分析xml时出错:未绑定前缀,android,Android,我的环境是 月食:3.2 安卓:2.3 <?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_heig

我的环境是 月食:3.2 安卓:2.3

<?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>

添加xmlns:android=”http://schemas.android.com/apk/res/android“要根目录LinearLayout

每个xml文件都需要有一个名称空间,该名称空间使用xmlns在xml文件的根标签中定义。因此woodshy的建议正是您需要的,添加一个:
xmlns:android=”http://schemas.android.com/apk/res/android
到xml文件中的第一个线性布局