【问题标题】:Line between Sliding Tabs and Toolbar滑动选项卡和工具栏之间的线
【发布时间】:2015-05-13 08:08:47
【问题描述】:

如何删除这一行:

我试图移除海拔:

<the.example.com.slidingtab.SlidingTabLayout
    android:id="@+id/tabs"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:elevation="2dp"
    android:background="@color/colorPrimary"/>

但我想要滑动标签下的阴影。

【问题讨论】:

  • 发布您的代码和 xmls
  • 如何更改我发布的 xml 以查看阴影?

标签: android slidingmenu


【解决方案1】:

高程是为 Android 5.0 API 级别 21 LOLLIPOP 定义的。 我不知道你的目的是什么,但为了我的目的 我会以 21 之前的设备为目标,并在其上绘制阴影(如果没有其他帮助,&lt;FrameLayout...&gt; 可以将其子代绘制在另一个之上)。

例如,horiz_line.xml

<View xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_height="2dip"
    android:layout_width="match_parent"
    android:background="#000000"
    />

&lt;LinearLayout ...&gt;用作

<include layout="@layout/horiz_line"/>

画一条简单的水平线。如果需要阴影,可以使用 9-patch 图像,在透明背景上绘制深色阴影。

【讨论】: