ヘッダーとフッターを含むレイアウトを取得するには、次の設定が必要です。アクティビティはダイアログに表示されるので、先頭の要素の高さを "wrap_content"に設定します。アンドロイドのドキュメントに関して、alignParentBottm = "true"を子要素に設定している限り、これは不可能です。alignParentBottom = "true"のないRelativeLayoutのヘッダー、コンテンツ、フッター
誰かがLinearLayoutを使用するように提案し、プログラムによってmaxHeightを設定しました。 alignParentBottom = "true"を避ける他の方法はありますか?
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:id="@+id/LNL_TOP"
android:layout_width="match_parent"
android:layout_height="60dip"
android:layout_alignParentTop="true">
</LinearLayout>
<LinearLayout
android:id="@+id/LNL_BOTTOM"
android:layout_width="match_parent"
android:layout_height="60dip"
android:layout_alignParentBottom="true">
</LinearLayout>
<LinearLayout
android:id="@+id/LNL_CONTENT"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/LNL_TOP"
android:layout_above="@+id/LNL_BOTTOM">
<ListView
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
</RelativeLayout>
ここでは、現在の外観をイメージしています。レイアウトでコンテンツを囲み、リストの下の空きスペースを避けてください。
画像を投稿することはできますか? –
私の質問に画像を追加 – timoschloesser
シンプルなLinearLayoutを使用すると何が問題になりますか? <のLinearLayout layout_height = "wrap_content"> のLinearLayout –
Jave