2012-03-12 3 views
0

Friends、 3つのLinearLayoutsを含むLinearLayoutがあります。 1.見出しのLinearLayout 2.コンテンツのLinearLayout 3.フッターのLinearLayoutはScrollViewは常に画面全体に展開します

2.コンテンツのLinearLayoutは、実行時に動的にコンテンツを取得します。多くのTextViewが追加されます。したがって、このレイアウトはScrollViewでなければなりません。

私の場合の問題は、すべての画面がレイアウト2ではなく永続的にスクロール可能であることです。コンテンツLinearLayout。

これは、問題の原因である可能性がある場合は、マップを含むSlidingDrawerでもあります。ご支援のための

Thxを、私のコードの相続一部:

<LinearLayout android:layout_width="fill_parent" 
    android:layout_height="fill_parent" android:orientation="vertical"> 

    <LinearLayout android:layout_width="match_parent" 
     android:layout_height="wrap_content" android:layout_marginTop="1dp" 
     android:orientation="horizontal" android:weightSum="50"> 

     <ImageButton android:id="@+id/1" 
      android:layout_width="fill_parent" android:layout_height="wrap_content" 
      android:layout_weight="10" android:src="@drawable/appiconone" /> 

     <TextView android:id="@+id/1" 
      android:layout_width="fill_parent" android:layout_height="wrap_content" 
      android:layout_weight="10" /> 

     <TextView android:id="@+id/2" 
      android:layout_width="fill_parent" android:layout_height="wrap_content" 
      android:layout_weight="10" android:text="" /> 

     <TextView android:id="@+id/4" 
      android:layout_width="fill_parent" android:layout_height="wrap_content" 
      android:layout_weight="10" android:text="" /> 

     <ImageButton android:id="@+id/5" 
      android:layout_width="fill_parent" android:layout_height="wrap_content" 
      android:layout_weight="10" android:src="@drawable/appiconone" /> 
    </LinearLayout> 

    <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
     android:layout_width="wrap_content" android:layout_height="wrap_content"> 

     <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
      android:id="@+id/LL2Content" 
      android:layout_width="match_parent" android:layout_height="match_parent" 
      android:orientation="vertical"> 

     </LinearLayout> 

    </ScrollView> 

    <LinearLayout android:layout_width="match_parent" 
     android:layout_height="wrap_content" android:layout_marginTop="20dp" 
     android:orientation="horizontal" android:weightSum="100"> 

     <Button android:id="@+id/10" 
      android:layout_width="fill_parent" android:layout_height="wrap_content" 
      android:layout_weight="50" android:text="" /> 

     <Button android:id="@+id/11" 
      android:layout_width="fill_parent" android:layout_height="wrap_content" 
      android:layout_weight="50" android:text="" /> 


    </LinearLayout> 
</LinearLayout> 
+0

トライアンドロイド:スクロールバー= "なし" – Android

答えて

0

はちょうどこのようなあなたのScrollViewの高さの修正を変更しても

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="wrap_content" android:layout_height="370dp" android:fillViewport="true"> 

私はこのことを願っていますScrollViewにfillViewportを追加しますあなたのために働くでしょう...

0

ステップ1:相対レイアウトを使用してヘッダー、コンテンツ、フッターのレイアウトを維持します。
ステップ2:ヘッダーとフッターを再利用可能にするために、ヘッダーとフッターのレイアウトを作成し、メインレイアウトに含めます。
ステップ3:ヘッダーの下とフッターレイアウトの上にコンテンツ領域を置きます。
ステップ4:

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" android:layout_height="fill_parent" android:fillViewport="true"> 
関連する問題