ExpandableListView不显示Viewpager android中的最后一项

时间:2018-11-21 09:03:22

标签: android android-viewpager expandablelistview

ExpendableListView似乎在屏幕底部显示。 我在NestedScrollview中使用了ExpendableListview,并在Viewpager中显示了这两件事。

问题是当我展开列表项目时,最后一个项目被渲染到视线之外。 Like in This Image

我也在使用 NonScrollExpandableListView

有人知道如何克服这个问题吗?

NonexpandbleListView布局(在viewpager中使用片段)

android.support.v4.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".before_u_start.beforeViewPagerFrag.BeforeSleepCoachingFrag">

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">

    <br.tiagohm.markdownview.MarkdownView
        android:id="@+id/markDownView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:escapeHtml="false" />

    <com.example.poplify.baby_guru_sample.custom_expendable.NonScrollExpandableListView
        android:id="@+id/lvexpand"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        android:childDivider="@color/white"
        android:choiceMode="multipleChoice"
        android:divider="@color/white"
        android:groupIndicator="@null"
        android:scrollbars="none"
        android:visibility="visible" />

</LinearLayout>

ViewPager布局

<include
    android:id="@+id/toolbar_we_start1"
    layout="@layout/toolbar" />


<android.support.design.widget.CoordinatorLayout
    android:id="@+id/cord"
    android:layout_width="match_parent"
    android:layout_height="0dp"
    app:layout_constraintBottom_toTopOf="@id/let_start_btn"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toBottomOf="@id/toolbar_we_start1">

    <android.support.design.widget.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:fitsSystemWindows="true"
        android:id="@+id/app_bar_layout">

           <FrameLayout
               android:id="@+id/relativeLayout4"
               android:layout_width="match_parent"
               android:layout_height="match_parent"
               app:layout_scrollFlags="scroll"

               android:background="@color/white"
               app:layout_collapseMode="parallax">

               <RelativeLayout
                   android:layout_width="match_parent"
                   android:layout_height="wrap_content"
                   android:background="@drawable/before_we_start" >

                   <ImageView
                       android:layout_width="@dimen/_146sdp"
                       android:layout_height="@dimen/_146sdp"
                       android:layout_centerHorizontal="true"
                       android:layout_marginBottom="@dimen/_minus43sdp"
                       android:src="@mipmap/large_logo"
                       android:visibility="visible" />
               </RelativeLayout>
           </FrameLayout>

    </android.support.design.widget.AppBarLayout>


    <android.support.v4.widget.NestedScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:clipToPadding="false"
        android:fillViewport="true"
        android:visibility="visible"
        app:layout_anchor="@id/app_bar_layout"
        app:layout_anchorGravity="bottom|center_horizontal"
        app:layout_behavior="@string/appbar_scrolling_view_behavior">

        <android.support.constraint.ConstraintLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:background="@color/white"
            android:visibility="visible">

            <android.support.design.widget.TabLayout
                android:id="@+id/tabLayoutBefore"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginStart="@dimen/_28sdp"
                android:layout_marginTop="@dimen/_72sdp"
                android:layout_marginEnd="@dimen/_28sdp"
                android:background="@drawable/child_btn_bg"
                android:theme="@style/Base.Widget.Design.TabLayout"
                app:layout_constraintBottom_toTopOf="@id/pagerForBefore"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent"
                app:layout_constraintVertical_chainStyle="packed"
                app:tabTextAppearance="@android:style/TextAppearance.Widget.TabWidget" />

            <android.support.v4.view.ViewPager
                android:id="@+id/pagerForBefore"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/_10sdp"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/tabLayoutBefore" />
        </android.support.constraint.ConstraintLayout>

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

</android.support.design.widget.CoordinatorLayout>


<Button
    android:id="@+id/let_start_btn"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginStart="@dimen/_43sdp"
    android:layout_marginTop="@dimen/_14sdp"
    android:layout_marginEnd="@dimen/_43sdp"
    android:background="@drawable/let_start"
    android:gravity="center_vertical|center_horizontal"
    android:padding="@dimen/_15sdp"
    android:text="@string/let_start_btn"
    android:textAllCaps="false"
    android:layout_marginBottom="@dimen/_8sdp"
    android:textColor="@color/white"
    android:textSize="@dimen/_15sdp"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toBottomOf="@id/cord"
    app:layout_constraintVertical_chainStyle="packed" />

0 个答案:

没有答案