android CoordinatorLayout里viewpager占据整个页面

<LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        app:layout_behavior="@string/appbar_scrolling_view_behavior">

        <com.ogaclejapan.smarttablayout.SmartTabLayout xmlns:android="http://schemas.android.com/apk/res/android"
            xmlns:app="http://schemas.android.com/apk/res-auto"
            android:id="@+id/courseDetailTab"
            android:layout_width="match_parent"
            android:layout_height="48dp"
            android:paddingBottom="4dp"
            app:stl_defaultTabTextColor="@color/selected_unselected"
            app:stl_distributeEvenly="true"
            app:stl_indicatorColor="@color/colorPrimary"
            app:stl_indicatorCornerRadius="1.5dp"
            app:stl_indicatorInterpolation="smart"
            app:stl_indicatorThickness="3dp"
            app:stl_underlineColor="@color/white" />

        <androidx.viewpager.widget.ViewPager
            android:id="@+id/videoViewpager"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_below="@id/courseDetailTab" />

    LinearLayout>

解决问题关键语句

app:layout_behavior="@string/appbar_scrolling_view_behavior">

你可能感兴趣的:(Android)