我正在尝试使用支持库中的新nestedScrollView.我希望可滚动内容扩展到匹配父级,如果它更小.我看到要这样做,我应该将fillViewport = true添加到nestedScrollView.当我这样做时,我的可滚动内容不会垂直拉伸,而是在屏幕外水平延伸.
布局card_movie只有一个RelativeLayout,里面有一些TextViews和一个ImageView.没什么特别的.
解决方法
我这样用它:
<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"
...
也许不同之处在于线性布局具有指定的方向,或者我使用的是更新的库com.android.support:design:23.1.0,这就是为什么我无法重现您的问题.