FrameLayout does not match the height of NestedScrollView

血红的双手。 提交于 2019-12-05 16:40:00

问题


I have a FrameLayout inside a NestedScrollView, as

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

        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="#000000">

But the FrameLayout is not filling the height of the NestedScrollView. How might I fix this?


回答1:


Check This Solution
Use fillViewport="true" this attribute causes the scroll view’s child to expand to the height of the ScrollView if needed. When the child is taller than the ScrollView, the attribute has no effect.

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


来源:https://stackoverflow.com/questions/33962307/framelayout-does-not-match-the-height-of-nestedscrollview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!