在我决定添加滚动视图之前,我的布局是完美的。
<?xml version="1.0" encoding="utf-8"?>
<TableLayout android:id="@+id/tableLayout1" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android">
<ScrollView android:id="@+id/scrollView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" >
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:id="@+id/linearLayout1">
<TableLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/tableLayout1"/>
</LinearLayout>
</ScrollView>
<Button android:layout_width="match_parent" android:id="@+id/button1" android:text="Start" android:layout_height="50dip" android:onClick="getOutput"></Button>
</TableLayout>
我希望按钮留在屏幕底部,实际上我希望滚动视图占据整个屏幕。仅使用内部表格布局就可以正常工作。在图形布局预览中,它看起来像我想要的那样,但不是在我运行它时。
我希望滚动视图占据整个屏幕,除了按钮,我想在底部。