Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android NestedScrollView fillViewport stretching incorrectly

I am trying to use the new NestedScrollView from the support libraries. I want the scrollable content to expand to match parent if it is smaller. I see that to do that, I'm supposed to add fillViewport=true to the NestedScrollView. When I do this, my scrollable content doesn't stretch vertically, it instead stretches horizontally off-screen. enter image description here

The layout card_movie simply has a RelativeLayout with some TextViews and one ImageView inside it. Nothing special. enter image description here

like image 945
Joe Avatar asked Aug 18 '15 07:08

Joe


1 Answers

I have used it like this:

<android.support.v4.widget.NestedScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"
        android:fillViewport="true">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical" 
            ...

Maybe the difference is that the linear layout has a specified orientation or maybe I am using a more updated library com.android.support:design:23.1.0 and that is the reason why I cant reproduce your problem.

like image 193
Ultimo_m Avatar answered Sep 28 '22 08:09

Ultimo_m