带有CoordinatorLayout的TabLayout的奇怪行为

时间:2017-01-30 08:09:57

标签: android material-design android-tablayout

我希望看看我的应用的实质外观,并且我在设备上实现了这一点< Android 5.0版:

enter image description here

但如果我在设备上运行app> = Android 5.0,我会得到: enter image description here

我正在使用寻呼机片段:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">

<android.support.design.widget.AppBarLayout
    android:id="@+id/app_bar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">

    <android.support.design.widget.TabLayout
        android:id="@+id/tabs"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:tabGravity="fill"
        app:tabMode="scrollable"
        app:tabTextAppearance="@style/CustomPagerTextStyle" />

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

<android.support.v4.view.ViewPager
    android:id="@+id/viewpager"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_below="@+id/app_bar"
    app:layout_behavior="@string/appbar_scrolling_view_behavior" />

和细节片段:

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:ads="http://schemas.android.com/apk/res-auto"
    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"
    android:fitsSystemWindows="true"
    tools:context="com.socialproof.channelinfo.view.activity.WorkActivity">

<ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent">

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

              ....

        </LinearLayout>

</ScrollView>

<com.github.ivbaranov.mfb.MaterialFavoriteButton
   ... />

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

0 个答案:

没有答案