1

我在尝试让我的工具栏看起来像 Play 商店中的工具栏时遇到问题。

这就是它的外观,注意文本没有变暗,它是亮白色: http: //prntscr.com/4zlttl

这就是它在我的应用程序中的外观:http: //prntscr.com/4zlubl

请注意,在我的应用程序中,文本以及工具栏是如何变暗的,而在 Play 商店中,工具栏是变暗的,但文本不是。

有谁知道我如何得到这个外观?

提前致谢!

编辑:这是我遇到的相同问题 - http://webcache.googleusercontent.com/search?q=cache:https://stackoverflow.com/questions/26543797/remove-navigationdrawer-s-shadow-on-工具栏

4

1 回答 1

1

您可以自定义工具栏样式。

定义您的工具栏并设置样式和主题。

<android.support.v7.widget.Toolbar
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    style="@style/HeaderBar"
    app:theme="@style/ActionBarThemeOverlay"
    app:popupTheme="@style/ActionBarPopupThemeOverlay"/>

使用该主题,您可以自定义内部的 UI 元素:

<style name="ActionBarThemeOverlay" parent="">
    <item name="android:textColorPrimary">#fff</item>  
    <item name="colorControlNormal">#fff</item>
    <item name="colorControlHighlight">#3fff</item>
</style>

使用样式,您可以自定义例如背景颜色。

<style name="HeaderBar">
    <item name="android:background">?colorPrimary</item>
</style>
于 2014-10-26T08:29:41.190 回答