しばらくの間、これに苦労しています。さまざまな LinearLayouts で構成されるレイアウト XML があり、個別の重み付けがあります。最終結果は次のようになります。
色は気にしないでください。ブレークポイントを確認するだけです。とにかく、Terminal/Origin などの下の LinearLayout は、カスタム アダプターを使用して設定された ListView です。データは正常に読み込まれますが、listView が LinearLayout から「抜け出し」、ページの大部分を占めます。
(色は気にしないでください。ブレークポイントを確認するだけです..)
すなわち。ビューの上下に流れます。
私のXMLは次のとおりです。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:ignore="HardcodedText" >
<RelativeLayout
android:id="@+id/navigation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.2"
android:background="#FF0000"
android:gravity="right" >
<Button
android:id="@+id/update"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:onClick="getFlightInfo"
android:text="Refresh" />
</RelativeLayout>
<LinearLayout
android:id="@+id/table_header"
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="0.4"
android:background="#FFFFFF"
android:weightSum="1" >
<TextView
android:id="@+id/header_cell1"
android:layout_width="0px"
android:layout_height="fill_parent"
android:layout_weight="@string/cell_1_weight"
android:gravity="center_vertical"
android:paddingLeft="5dp"
android:paddingRight="12dp"
android:text="@string/table_header_terminal"
android:textSize="11dp" />
<TextView
android:id="@+id/header_cell2"
android:layout_width="0px"
android:layout_height="fill_parent"
android:layout_weight="@string/cell_2_weight"
android:gravity="center_vertical"
android:paddingRight="12dp"
android:text="@string/table_header_origin"
android:textSize="11dp" />
<TextView
android:id="@+id/header_cell3"
android:layout_width="0px"
android:layout_height="fill_parent"
android:layout_weight="@string/cell_3_weight"
android:gravity="center_vertical"
android:paddingRight="12dp"
android:text="@string/table_header_flight"
android:textSize="11dp" />
<TextView
android:id="@+id/header_cell4"
android:layout_width="0px"
android:layout_height="fill_parent"
android:layout_weight="@string/cell_4_weight"
android:gravity="center_vertical"
android:paddingRight="12dp"
android:text="@string/table_header_scheduled"
android:textSize="11dp" />
<TextView
android:id="@+id/header_cell5"
android:layout_width="0px"
android:layout_height="fill_parent"
android:layout_weight="@string/cell_5_weight"
android:gravity="center_vertical"
android:paddingRight="12dp"
android:text="@string/table_header_status"
android:textSize="11dp" />
</LinearLayout>
<LinearLayout
android:id="@+id/table_list_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="3"
android:background="#FFFFFF"
android:orientation="vertical" >
<ListView
android:id="@+id/list_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
</ListView>
</LinearLayout>
<LinearLayout
android:id="@+id/filter"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#00FF00" />
</LinearLayout>
まぶしい何かが欠けているかもしれませんが、私の人生では、それを見ることはできません。誰でも助けることができますか?
どうもありがとう..