ここで非常に奇妙な問題があります。次のxmlセクションでは、インクルードを使用しようとしています:
<!-- CONTENT --> <ScrollView android:layout_width="fill_parent" android:layout_height="fill_parent" android:fadingEdge="none"> <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent"> <include android:id="@+id/summary" layout="@layout/view_summary" android:layout_width="fill_parent" android:layout_height="fill_parent"/> </LinearLayout> </ScrollView>
(セクションは縦方向のメイン リニア レイアウトで、幅と高さの両方が親を埋めるように設定されています)
含まれているxml:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/white">
<ListView android:id="@+id/news_list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:cacheColorHint="@color/transparent"
android:background="@color/transparent" />
<Button android:id="@+id/news_load_more"
android:layout_width="fill_parent"
android:layout_height="40dip"
android:text="Load more..."/>
</LinearLayout>
問題は、ListView が全高 (画面の高さ) を占めておらず、1 つのリスト項目のサイズのみを占めていることです。コードからレイアウト パラメータを設定しようとしましたが、役に立ちませんでした。
どんなアイデアでも大歓迎です。ありがとう。