2016-07-14 13 views
0

私はActivityに問題があります。 ScrollViewは下にスクロールしません。 はここにScrollViewの私のXMLレイアウトです:スクロール表示がパディングで正しく機能しない

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:background="@drawable/test" 
      android:paddingRight="@dimen/layoutsPadding" 
      android:paddingTop="@dimen/layoutsPadding" 
      android:paddingLeft="@dimen/layoutsPadding" 
      android:paddingBottom="@dimen/scrollViewLayoutsPadding"> 

    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:background="@color/tab_introduction_background" 
     android:orientation="vertical" 
     android:padding="@dimen/layoutsPadding"> 

     <TextView 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:text="@string/tab_introduction_title" 
      android:textSize="@dimen/bigFont"></TextView> 

     <LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="@dimen/gap_titleAndText"> 
     </LinearLayout> 

     <TextView 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:text="@string/tab_introduction_description" 
      android:textSize="@dimen/smallFont"></TextView> 
    </LinearLayout> 

</ScrollView> 

私は何ができますか? LinearLayoutの詰め物を取り除くので、

+0

'LinearLayout'のパディングを削除してください。 –

+0

が働いていましたが、直線的なレイアウトにパディングがあります。 –

+0

答えを確認してください。それがあなたのために働かないかどうか私に知らせてください。 –

答えて

0

が働いていますが、それはパディングを持ちたい、ちょうど別のLinearLayoutでそれを囲むとパディングを持っているだけで、この外側LinearLayoutをさせない理由。そして内部のLinearLayoutのパディングを取り除いてください。これはおそらく非常に良いスタイルではありませんが、試してみる価値があります。

これを避けたい場合は、LinearLayoutからパディングを削除し、すべての子に余白を追加することもできます。

EDIT:あなたは本当に下に空のビューは間違いなくあなたの問題を解決する追加、そのパディングを必要とするが、それはどちらか良い解決策ではありませんので:

<View 
android:layout_width="fill_parent" 
android:layout_height="30dp" /> 
+0

LinearLayoutには3つのchildernがあります。私はそれを試してみる –

+0

そう、彼らに余白を追加し、LinearLayoutのパディングを削除します。この問題は、ScrollViewとその子LinearLayoutが両方ともパディングを持つために発生します。 –

+0

は機能しませんでした。再び –

関連する問題