ScrollView Layout does not fill the whole screen

后端 未结 5 2037
一整个雨季
一整个雨季 2021-01-31 06:54

I got an Activity with two Fragments (one list one normal). And the normal Fragment inflates a Scrollview containing a

5条回答
  •  一生所求
    2021-01-31 07:45

    If i'm not mistaken, the ViewGroup's height (LinearLayout's height in your case), that is the (only) child inside a ScrollView, is always interpreted as wrap_content, since that content can be larger than the ScrollView's height (hence the scrollbars).

    This also means that if the content is smaller, the ScrollView's content (child) may not necessarily stretch to fill the screen.

    In order to visually help you fix this, we need to see a screenshot of your problem.

    Maybe setting android:fillViewport="true" on the ScrollView will fix your issue:

    
    

提交回复
热议问题