摆脱我的行动吧和pagertabview之间的行分隔符:我的、行动、分隔符、pagertabview

由网友(山河与我共相候)分享简介:我试图摆脱我的行动吧和pagertabview之间的行分隔符:I'm trying to get rid of this line separator between my action-bar and pagertabview:没有谷歌如何做到这一点?How did Google achieve this?推荐答...

我试图摆脱我的行动吧和pagertabview之间的行分隔符:

I'm trying to get rid of this line separator between my action-bar and pagertabview:

没有谷歌如何做到这一点?

How did Google achieve this?

推荐答案

这是不是一个真正的行分隔符,它是一个影子,表明操作栏是在更高的海拔比标签栏。

That isn't really a line separator, it is a shadow indicating that the Action Bar is at a higher elevation than the tab bar.

假设你正在使用AppCompat,你可以使用 ViewCompat.setElevation() 上设置标签页的标高为支持它的设备(那些运行API 21 +)。

Assuming you are using AppCompat, you can use ViewCompat.setElevation() to set the elevation on your tabs for devices that support it (those running API 21+).

您code可能看起来是这样的:

Your code might look something like this:

View tabs = findViewById(R.id.the_tabs_id)
ViewCompat.setElevation(tabs, getResources().getDimension(R.dimen.action_bar_elevation));

我使用4DP作为 action_bar_elevation 尺寸。

pre 5.0:

  <style name="AppTheme" parent="@android:style/Theme.Holo.Light">
        <item name="android:windowContentOverlay">@null</item>
    </style>
阅读全文

相关推荐

最新文章