首页 > 解决方案 > 海拔没有阴影

问题描述

我的标签下面不会显示任何阴影,我的代码有什么问题:

<LinearLayout 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:background="#171717"
    android:orientation="vertical">

    <android.support.design.widget.TabLayout
        android:id="@+id/tabLayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:minHeight="?actionBarSize"
        android:elevation="10dp"
        app:tabBackground="@color/tabBackground"
        app:tabGravity="fill"
        app:tabIndicatorColor="#425ced"
        app:tabIndicatorHeight="4dp"
        app:tabMode="fixed"
        app:tabSelectedTextColor="#425ced"
        app:tabTextColor="#e5e5e5"
        >
    </android.support.design.widget.TabLayout>

    <android.support.v4.view.ViewPager
        android:id="@+id/viewPager"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:elevation="0dp"/>
</LinearLayout>

标签: androidandroid-layoutandroid-tablayout

解决方案


你不应该使用

android:elevation="10dp"

用这个

app:elevation="10dp"

并将您的支持库升级到最新版本以获得更好的性能。祝你好运


推荐阅读