我正在尝试将此工具栏颜色完全白色更改为 Android Lollipop 设置 操作栏颜色 但是,存在错误或其他问题在我们看来就是这样,或者可能是 Android 错误!!
我的工具栏:
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:popupTheme="@style/Theme.AppCompat.Light"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" />
风格:
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="drawerArrowStyle">@style/DrawerArrowStyle</item>
和样式箭头:
<style name="DrawerArrowStyle" parent="Widget.AppCompat.DrawerArrowToggle">
<item name="spinBars">true</item>
<item name="color">@android:color/white</item>
</style>
结果:
如您所见,名称是黑色!,添加这些后,搜索图标有点黑色。 (你可以试试 ;) )
但我需要带有白色 Action 的全白颜色。
如何实现这一点?
我已经尝试了你能想到的一切!
最佳答案
你可以试试这个:
只需在 AppBarLayout
中添加:app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
例如:
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar_layout"
android:layout_width="match_parent"
android:layout_height="256dp"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
对于 PopUptheme
:
<android.support.v7.widget.Toolbar
android:id="@+id/Main_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:popupTheme="@style/Theme.AppCompat.Light" />
但我不知道那个搜索 Action ,也不知道为什么它仍然有点黑。
如果有人知道,请指导我们。
关于android - 如何使用协调器布局和自定义工具栏更改 android 标题颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32538293/