摆脱我的行动吧和pagertabview之间的行分隔符: [英] Get rid of this line separator between my action-bar and pagertabview:

查看:189
本文介绍了摆脱我的行动吧和pagertabview之间的行分隔符:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图摆脱我的行动吧和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,你可以使用<一个href="http://developer.android.com/reference/android/support/v4/view/ViewCompat.html#setElevation(android.view.View,%20float)"相对=nofollow> 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>

这篇关于摆脱我的行动吧和pagertabview之间的行分隔符:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆