ScrollView是一個FrameLayout,這意味着你應該在其中放置一個包含整個內容滾動的子項;這個孩子本身可能是一個具有複雜對象層次結構的佈局管理器。一個經常使用的孩子是一個垂直方向的LinearLayout,呈現一個頂級項目的垂直數組,用戶可以滾動瀏覽。
<ScrollView
android:id="@+id/ScrollView01"
android:layout_height="150px"
android:layout_width="fill_parent">
<TextView
android:id="@+id/TEXT_VIEW"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="This text view should act as header This text view should act as header This text view should act as header This text view should act as header This text view should act as header This text view should act as header This text view should act as header" />
</ScrollView>
你有固定數量的textviews或它是動態的嗎? – mudit 2012-03-01 13:27:56
只是2.現在。未來可能會更多,但佈局是靜態的,如果這是問題。 – 2012-03-01 13:58:39