私の LinearLayout には 2 つの子 ViewGroups があり、基本的にはそれぞれに 50% のスペースを確保したいのですが (それは完了しています)、これらの ViewGroups の 1 つのコンテンツが 50% よりもはるかに小さい可能性もあります。 、2番目のビューを残りのスペースと一致させる方法はありますか?
今、私のレイアウトは次のようになります。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:orientation="horizontal"
android:weightSum="1">
<include layout="@layout/layout1"
android:layout_width="0dip"
android:layout_weight="0.5"
android:layout_height="match_parent" />
<include layout="@layout/layout2"
android:layout_width="0dip"
android:layout_weight="0.5"
android:layout_height="match_parent" />
そして、私が達成したいのは、1 つのレイアウト wrap_content ですが、50% 以下であり、2 番目のレイアウトが残りのスペースを埋めることです。
前もって感謝します!