請看看以下的Android XML文件,該文件是負責創建GUI無法滾動
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="fill_parent"
android:layout_width="fill_parent">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/imageTitle"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="14dp"
android:text="@string/imageDate"
android:textAppearance="?android:attr/textAppearanceLarge" />
<ImageView
android:id="@+id/imageView1"
android:layout_width="match_parent"
android:layout_height="254dp"
android:layout_weight="0.34"
android:src="@drawable/test_image" />
<TextView
android:id="@+id/textView3"
android:layout_width="fill_parent"
android:layout_height="136dp"
android:text="@string/imageDescription" />
</LinearLayout>
</ScrollView>
我試圖滾動整個屏幕,但它沒有發生。上傳的圖片將清楚地向您說明。爲什麼它不滾動?我是android新手,這是我的第二個應用程序。請幫忙!
使用'wrap_content'您的LinearLayout – Praveenkumar 2012-07-27 06:01:57
實際上它需要WRAP_CONTENT即使我們給FILL_PARENT我猜。因爲在我的應用程序中,當我使用fill_parent時,它會要求使它成爲wrap_content,而我沒有,它仍然正常工作 – 2012-07-27 06:05:58