2017-11-08 15 views
-5

Scrollviewの下部から余分なスペースを削除する方法。以下は、2つの外部レイアウトを含むXMLレイアウトです。多くのソリューションを参照しているが、どれも私のために働いていない。Scrollviewの下部から余分なスペースを削除する方法

enter image description here

 <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:id="@+id/sc" 

     android:layout_marginBottom="55dp" 
     android:scrollbarAlwaysDrawVerticalTrack="true" 
     android:scrollbarStyle="outsideOverlay" 
     android:layout_weight="1" 
     android:fillViewport="true" 
     android:scrollbars="vertical"> 
     <LinearLayout 
      android:orientation="vertical" 
      android:layout_width="match_parent" 
      android:id="@+id/linprodetaill" 
      android:layout_above="@+id/bt" 
      android:layout_height="wrap_content"> 


      <include 
       android:id="@+id/l1" 
       layout="@layout/productexpand_items" /> 

      <include 
       android:id="@+id/l3" 
       layout="@layout/dynamic_view" 

       /> 

     </LinearLayout> 
    </ScrollView> 
+0

あなたのscrollView – Vodet

答えて

0

削除からandroid:layout_marginBottom="55dp"あなたScrollView

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:id="@+id/sc" 
    android:scrollbarAlwaysDrawVerticalTrack="true" 
    android:scrollbarStyle="outsideOverlay" 
    android:layout_weight="1" 
    android:fillViewport="true" 
    android:scrollbars="vertical"> 
    <LinearLayout 
     android:orientation="vertical" 
     android:layout_width="match_parent" 
     android:id="@+id/linprodetaill" 
     android:layout_above="@+id/bt" 
     android:layout_height="wrap_content"> 


     <include 
      android:id="@+id/l1" 
      layout="@layout/productexpand_items" /> 

     <include 
      android:id="@+id/l3" 
      layout="@layout/dynamic_view" 

      /> 

    </LinearLayout> 
</ScrollView> 
+0

内のマージン底を持って、私は必要がある上に二つのボタンがあります。このスクロール余裕を与えて –

+0

スクリーンショットを送信 –

+0

@AshutoshTripathiスクリーンショットのリンクを確認してください –

0

あなたのxmlからこの行を削除し

android:layout_marginBottom="55dp" 

余分なスペースを取り除くだけで十分なスペースを与えるために10dpを設定できます

0

scrollViewと他のレイアウトはRelative layoutにネストします。 を入力し、layout_below属性を使用して、scrollViewの下のレイアウトを揃えます。 とスクロールビューのxmlにlayout_alignParentTop="true"を含めて、スクロールビューの下端を削除してください。

今一番下のレイアウトが自分の視界値がVisibleGoneに変更がある場合、scrollViewが親を埋めるか、彼らのために部屋を残して、

関連する問題