NestedScrollView不尊重孩子的身高

时间:2017-06-16 14:29:31

标签: android height overlay android-nestedscrollview

我有一个包含标签布局和视图寻呼机的折叠布局。

在viewpager中,在第一个选项卡中,我有一个包含很多子项的NestedScrollView。问题是:NestedScrollView不尊重子高度。

<android.support.v4.widget.NestedScrollView
    android:id="@+id/nestedScrollView"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:isScrollContainer="true"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_gravity="fill_vertical"
    android:fillViewport="true"
    android:background="@color/colorBlack"
    app:layout_behavior="@string/appbar_scrolling_view_behavior">

    <LinearLayout
        android:id="@+id/relative"
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="24dp"
        android:paddingRight="16dp"
        android:paddingLeft="16dp"
        android:clipToPadding="false">

        .... Lots of children

    </LinearLayout>

</android.support.v4.widget.NestedScrollView>

此LinearLayout的最后一个TextView不显示。如果我在50dp的TextView中放置一个边距底部,它会显示。

我失踪了什么?

完整代码:https://gist.github.com/guuilp/81f06c8a5581d2a9ce0a19dcf6c12ccc

0 个答案:

没有答案
相关问题