【发布时间】:2019-05-30 14:46:11
【问题描述】:
我有一个工具栏,我想将背景更改为黑色,但默认情况下项目颜色为黑色,我想将其颜色更改为灰色,我该怎么做?非常感谢: My Image about Toolbar
这是我的toolbar.xml
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#2196F3"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
我的样式.xml
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
【问题讨论】:
-
你想改变图标的颜色吗?
-
是的,改成灰色
-
这些图标是你创建的还是导入的?
-
<item android:id="@+id/slash_toolbar" android:title="" android:icon="@drawable/ic_voice" app:showAsAction="always" />这就是我创建它的方式 -
好的,在创建图标时您可以选择颜色。我会告诉你如何
标签: android material-design android-toolbar android-color