ScrollView
の中にリスト(TextView
がLinearLayout
の中にあります)を持つダイアログがあります。次のようなレイアウトは次のとおりです。スクロールビューでダイアログ内の最下部が消えます
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ProgressBar
android:id="@+id/delete_progress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone" />
<ScrollView
android:id="@+id/filename_scroll"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:id="@+id/filename_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
</LinearLayout>
</ScrollView>
<View
android:id="@+id/horisontal_separator"
android:layout_width="fill_parent"
android:layout_height="1dp"
android:background="@android:color/darker_gray" />
<LinearLayout
android:id="@+id/button_container"
android:layout_width="match_parent"
android:layout_height="48dp" >
<Button
android:id="@+id/load_button"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/button_load"
android:gravity="center"
android:layout_weight="1" />
<View
android:layout_width="1dp"
android:layout_height="fill_parent"
android:background="@android:color/darker_gray" />
<Button
android:id="@+id/delete_button"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/button_delete"
android:gravity="center"
android:layout_weight="1" />
</LinearLayout>
</LinearLayout>
:
しかし、画面に収まらないほどあります(とスクロールする実際の必要性があります)とき私のボタンは画面の下に押し込まれます。下のすべての方法をスクロールすると、それは次のようになります。私はフッターとして滞在するボタンを含むLinearLayout
が必要
、それはどこにもスクロールしないと明らかに消えるべきではありません。私はレイアウトの高さと重さを手に入れようとしましたが、無駄にしました。
ListViewを固定高さ、たとえば200dipに設定しようとしましたか? – Demonick
私は実際の 'ListView'を持っていませんが、' LinearLayout'の高さを変更しても違いはありません。そして 'ScrollView'の高さを変更すると、ボタンが再び押し出されます。 – j0ntech