2

ここで非常に奇妙な問題があります。次の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 つのリスト項目のサイズのみを占めていることです。コードからレイアウト パラメータを設定しようとしましたが、役に立ちませんでした。

どんなアイデアでも大歓迎です。ありがとう。

4

3 に答える 3

0

Add android:layout_weight="0"to <Button android:id="@+id/news_load_more" ... /> This は<ListView android:id="@+id/news_list" ...>、親を埋めるために展開されるものであることを通知しますが、ボタンは展開してはなりません。

于 2011-06-12T16:34:03.030 に答える
-1

android:layout_height="fill_parent" の代わりに android:layout_height="wrap_content" を変更してください

ScrollView の高さプロパティのみが変更されました。

あなたの助けになるかもしれません。

于 2011-06-09T07:28:08.383 に答える