my Environment is eclipse :3.2 android: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"
and开发者_如何学运维roid: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>
add xmlns:android="http://schemas.android.com/apk/res/android" to root LinearLayout
every xml file needs to have a name space for it which is defined in the root tag of the xml file using the xmlns . So the suggestion by woodshy is exactly what you need ,add a : xmlns:android="http://schemas.android.com/apk/res/android
to the first LinearLayout in your xml file.
精彩评论