我有簡單的佈局是這樣的:(它是郵件)如何拉伸佈局以填充屏幕?
<ScrollView android:layout_height="0dp" android:layout_width="fill_parent" android:layout_weight="1" android:background="@color/red_start">
<LinearLayout android:layout_height="fill_parent" android:layout_width="fill_parent" android:orientation="vertical" android:background="@color/blue_start">
<TextView style="@style/MyTextViewLabel" android:text="From" android:layout_marginTop="5dp"/>
<LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@drawable/shape_white_rounded">
<TextView style="@style/MyTextViewLabel.Black" android:id="@+id/tv_sender" />
</LinearLayout>
<TextView style="@style/MyTextViewLabel" android:text="Subject" android:layout_marginTop="5dp"/>
<LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@drawable/shape_white_rounded">
<TextView style="@style/MyTextViewLabel.Black" android:id="@+id/tv_subject" />
</LinearLayout>
<TextView style="@style/MyTextViewLabel" android:text="Body" android:layout_marginTop="5dp"/>
<LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@drawable/shape_white_rounded">
<TextView style="@style/MyTextViewLabel.Black" android:id="@+id/tv_body" />
</LinearLayout>
</LinearLayout>
</ScrollView>
出於某種原因,如我所料的LinearLayout不會填滿滾動型。基本上,我想讓tv_body填充屏幕,如果有更多的文本 - 它應該是可滾動的。現在看起來像這樣。我添加顏色以表明滾動型彈力但LinearLayout中不..
很好,謝謝!這工作 – katit 2011-05-26 02:37:35
輝煌,幫助我以及.. – bluszcz 2012-04-29 19:10:48
我已經嵌套滾動視圖內的線性佈局。它在這種情況下不起作用:( – 2012-07-04 05:42:27