工具栏和标签之间的界限 - Android 5

时间:2015-04-26 12:47:30

标签: android tabs material-design

我的工具栏和我的标签之间有一条线,我不知道为什么,因为如果我的应用程序是在Android 4的另一部智能手机上执行的,那么这条线就消失了......

我正在使用标签工具栏,我正在使用Google的SlidingTabLayout和SlidingTabStrip ......

我不知道是否有一些重要的信息要说,但如果您需要了解更多信息,请告诉我......

Thankss

编辑:这是一张关于此的照片......

enter image description here

这是活动的布局:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="es.alejandrolora.devhub.activitys.VideosCommentsActivity">

<include
    android:id="@+id/toolbar"
    layout="@layout/toolbar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" />

<es.alejandrolora.devhub.Util.SlidingTabLayout
    android:id="@+id/tabs"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@color/colorPrimary"
    android:elevation="2dp" />

    <android.support.v4.view.ViewPager
        android:id="@+id/pager"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="1" />

2 个答案:

答案 0 :(得分:6)

我在摩托罗拉G2上的Android 5.0.2中尝试了我的应用程序并且该行不可见但是在我的Nexus 5版本(5.1)中,它是,但是我解决了问题...

我只需要删除这个属性:

android:elevation="2dp"

由于

答案 1 :(得分:5)

ToolbarSlidingTabLayout提供相同的高程值。因为如果Toolbar中有一些高程,它将再次显示该行。

在Lollipop中,Material设计引入了UI元素的高程,帮助用户理解每个元素的相对重要性,并将注意力集中在手头的任务上,以获取更多细节,请阅读:https://developer.android.com/training/material/shadows-clipping.html

简而言之: ToolbarSlidingTabLayout的提升应该相同。

相关问题