我做了一个简单的活动,因为我使用了 scrollView 但它不工作并显示错误,所以我删除了 scrollView ..我需要的朋友是所有菜单都应该包含在 scrollView 中。请任何人都可以建议我应该放在哪里我活动中的“scrollView”标签。
我的活动如下:
主菜单.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/linearLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent" android:orientation="vertical">
<ImageView
android:id="@+id/imageView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:src="@drawable/kevingreen" android:background="#000" android:layout_weight="1"/>
<LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="0.3"
android:background="#fffff3"
android:orientation="vertical" >
<LinearLayout
android:id="@+id/linearLayout4"
android:layout_width="fill_parent"
android:layout_height="190dp" >
<LinearLayout
android:id="@+id/linearLayout6"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:layout_weight="1"
android:orientation="vertical" >
<ImageButton
android:id="@+id/imageButtonVideos"
android:layout_width="fill_parent"
android:layout_height="115dp"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="20dp"
android:background="#0000"
android:scaleType="centerCrop"
android:src="@drawable/balcony_pic" />
<TextView
android:id="@+id/textView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:text="Videos"
android:textAppearance="?android:attr/textAppearanceMediumInverse"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="@+id/linearLayout7"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:layout_weight="1"
android:orientation="vertical" >
<ImageButton
android:id="@+id/ImageButtonTraining2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="20dp"
android:background="#0000"
android:scaleType="centerCrop"
android:src="@drawable/crowd_pic" />
<TextView
android:id="@+id/TextView02"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="0.6"
android:gravity="center"
android:text="Training"
android:textAppearance="?android:attr/textAppearanceMediumInverse"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="@+id/linearLayout8"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:layout_weight="1"
android:orientation="vertical" >
<ImageButton
android:id="@+id/ImageButtonCalculator"
android:layout_width="fill_parent"
android:layout_height="94dp"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="20dp"
android:background="#0000"
android:scaleType="fitCenter"
android:src="@drawable/calculator" />
<TextView
android:id="@+id/TextView01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="0.6"
android:gravity="center"
android:text="Property Calculator"
android:textAppearance="?android:attr/textAppearanceMediumInverse"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/linearLayout5"
android:layout_width="fill_parent"
android:layout_height="148dp"
android:layout_marginBottom="10dp" >
<LinearLayout
android:id="@+id/LinearLayout01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:layout_weight="1"
android:orientation="vertical" >
<ImageButton
android:id="@+id/ImageButtonShop"
android:layout_width="fill_parent"
android:layout_height="77dp"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="15dp"
android:background="#0000"
android:scaleType="centerCrop"
android:src="@drawable/compra" />
<TextView
android:id="@+id/TextView03"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:text="Shop"
android:textAppearance="?android:attr/textAppearanceMediumInverse"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="@+id/LinearLayout02"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:layout_weight="1"
android:orientation="vertical" >
<ImageButton
android:id="@+id/ImageButtonAboutKevin"
android:layout_width="fill_parent"
android:layout_height="82dp"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="15dp"
android:background="#0000"
android:scaleType="centerCrop"
android:src="@drawable/about_me_pic" />
<TextView
android:id="@+id/TextView04"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:text="About Kevin"
android:textAppearance="?android:attr/textAppearanceMediumInverse"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="@+id/LinearLayout03"
android:layout_width="84dp"
android:layout_height="match_parent"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:orientation="vertical" >
<ImageButton
android:id="@+id/ImageButtonLinks"
android:layout_width="fill_parent"
android:layout_height="88dp"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="15dp"
android:background="#0000"
android:scaleType="fitCenter"
android:src="@drawable/coaching_pic" />
<TextView
android:id="@+id/TextView05"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0.88"
android:gravity="center"
android:text="Social"
android:textAppearance="?android:attr/textAppearanceMediumInverse"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/linearLayoutthird"
android:layout_width="match_parent"
android:layout_height="102dp"
android:layout_marginBottom="10dp" >
<LinearLayout
android:id="@+id/LinearLayoutsubthird"
android:layout_width="298dp"
android:layout_height="fill_parent"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:layout_weight="0.83"
android:orientation="vertical" >
<ImageButton
android:id="@+id/ImageButtonBlog"
android:layout_width="130dp"
android:layout_height="102dp"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:background="#0000"
android:scaleType="centerCrop"
android:src="@drawable/blogger" />
<TextView
android:id="@+id/TextViewblogger"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:text="Blogger"
android:textAppearance="?android:attr/textAppearanceMediumInverse"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="@+id/LinearLayoutabout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:layout_weight="1"
android:orientation="vertical" >
<LinearLayout android:layout_width="fill_parent" android:id="@+id/LinearLayoutabout" android:layout_height="fill_parent" android:layout_marginBottom="10dp" android:layout_marginTop="10dp" android:layout_weight="1" android:orientation="vertical">
<ImageButton android:id="@+id/ImageButtonContactUs" android:layout_width="130dp" android:layout_height="102dp" android:layout_marginBottom="10dp" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" android:layout_marginTop="40dp" android:background="#0000" android:scaleType="centerCrop" android:src="@drawable/contact_us_478x318"/>
<TextView android:id="@+id/TextViewcontactus" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" android:gravity="center" android:text="Contact Us" android:textAppearance="?android:attr/textAppearanceMediumInverse" android:textStyle="bold"/>
</LinearLayout>
<ImageButton
android:id="@+id/ImageButtonContactUs"
android:layout_width="130dp"
android:layout_height="182dp"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="40dp"
android:background="#0000"
android:scaleType="centerCrop"
android:src="@drawable/contact_us_478x318" />
<TextView
android:id="@+id/TextViewcontactus"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:text="Contact Us"
android:textAppearance="?android:attr/textAppearanceMediumInverse"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/linearLayout3"
android:layout_width="fill_parent"
android:layout_height="fill_parent" android:layout_weight="1" android:background="@drawable/gradient_grey">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1" android:orientation="vertical">
<ImageButton
android:id="@+id/imageButtonHome"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:src="@drawable/g3570" android:layout_weight="0.6" android:background="#0000" android:scaleType="fitCenter" android:layout_marginTop="5dp"/>
<TextView android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:text="Home"
android:gravity="center" android:textAppearance="?android:attr/textAppearanceMediumInverse" android:textColor="#fff" android:textStyle="bold"/>
</LinearLayout> <LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1" android:orientation="vertical">
<ImageButton
android:id="@+id/imageButtonTraining"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:src="@drawable/g4404" android:layout_weight="0.6" android:scaleType="fitCenter" android:background="#0000" android:layout_marginTop="5dp"/>
<TextView android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:text="Training"
android:gravity="center" android:textAppearance="?android:attr/textAppearanceMediumInverse" android:textColor="#fff" android:textStyle="bold"/>
</LinearLayout> <LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1" android:orientation="vertical">
<ImageButton
android:id="@+id/imageButtonContactUs"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:src="@drawable/icon_email" android:layout_weight="0.6" android:scaleType="fitCenter" android:background="#0000" android:layout_marginTop="5dp"/>
<TextView android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:text="Contact Us"
android:gravity="center" android:textAppearance="?android:attr/textAppearanceMediumInverse" android:textColor="#fff" android:textStyle="bold"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
请告诉我应该在哪里放置scrollView标签,以便它能够正常工作..提前谢谢你。!