我有個親戚的佈局,我想它,使其滾動的,我做到了太多,但問題是它是即使它不需要滾動...相對佈局滾動發行
有聯繫,我請參閱但對我來說
how to make a relative layout scrollable when it has many children views?
這裏沒有工作是我的佈局
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/ScrollView01"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/ab" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="135dp"
android:layout_height="135dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="30dp"
android:src="@drawable/r" />
<TextView
android:id="@+id/rgpvtext"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/imageView1"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_marginTop="6dp"
android:text="RGPV Digest"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#5C9E70"
android:textSize="36sp" />
<TextView
android:id="@+id/compu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/rgpvtext"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_marginTop="25dp"
android:clickable="true"
android:text="Computer Science"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@drawable/texteff"
android:textSize="24sp" />
<TextView
android:id="@+id/calc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/compu"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:clickable="true"
android:text="Calculator"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@drawable/texteff"
android:textSize="24sp" />
<TextView
android:id="@+id/iv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/calc"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:clickable="true"
android:text="Interview Question"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@drawable/texteff"
android:textSize="24sp" />
<TextView
android:id="@+id/prog"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/iv"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:clickable="true"
android:text="Programs"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@drawable/texteff"
android:textSize="24sp" />
<TextView
android:id="@+id/abo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/prog"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:clickable="true"
android:text="About"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@drawable/texteff"
android:textSize="24sp" />
</RelativeLayout>
</ScrollView>
<ListView
android:id="@+id/drawerlist"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="left"
android:background="#5B9D79"
android:paddingTop="6dp" />
</android.support.v4.widget.DrawerLayout>
感謝你的努力,但它仍然不能正常工作,請檢查我的編輯 – 2015-02-10 08:59:28
Listview有它自己的滾動條。也許你應該刪除你的滾動視圖,因爲它沒用。添加列表項時,您的列表視圖將滾動。 – Jaky71 2015-02-10 09:12:02