下午好,彈力滾動型垂直
我對用戶的屏幕上正在逐漸生成的列表,(現在的名單是坐在一個滾動視圖,但可能不會是最後的歸宿。)以上scrollview是幾個按鈕,scrollview下面是幾個按鈕。滾動查看佔據整個屏幕的中間。
現在,當列表生成時,它將位於滾動視圖下的按鈕下。不過,我希望它停在頂端。同時尋找它始終顯示最後一行,而不是新的信息開始消失在底部。
我知道這可能是令人困惑的,所以如果您有任何問題,請讓我知道。
現在XML看起來有點像這樣,它也按照這個順序排列在屏幕上。
<Button
android:text="Ok"
android:id="@+id/buttonOk"
android:layout_height="wrap_content"
android:layout_width="75sp"
android:layout_below="@+id/textHoleNumber"
android:layout_alignParentRight="true"></Button>
<ScrollView <-- ***would like this to line up under the OK button***
android:layout_height="wrap_content"
android:id="@+id/scrollView1"
android:layout_width="fill_parent"
android:layout_below="@+id/buttonMinus">
<TextView
android:id="@+id/textScoreCard"
android:layout_height="wrap_content"
android:text="Score card info goes here"
android:textSize="20sp"
android:layout_width="fill_parent"></TextView>
</ScrollView> <-- ***would like this to stay above linear layout***
<LinearLayout
android:layout_width="fill_parent"
android:id="@+id/linearLayout1"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true">
<Button
android:layout_height="wrap_content"
android:layout_width="0dip"
android:layout_weight="1"
android:id="@+id/buttonSave"
android:text="Save"></Button>
<Button
android:id="@+id/buttonReset"
android:layout_height="wrap_content"
android:layout_width="0dip"
android:layout_weight="1"
android:layout_toRightOf="@+id/buttonSave"
android:layout_alignTop="@+id/buttonSave"
android:layout_alignBottom="@+id/buttonSave"
android:text="Reset"></Button>
</LinearLayout>
謝謝!這就像一個魅力。我已經試過保證金和傳遞的滾動視圖,但我不認爲包括-60sp在scrollview下面的linearlayout。 – Rob 2011-06-08 00:51:29