【问题标题】:Change color of burger icon into android toolbar将汉堡图标的颜色更改为 android 工具栏
【发布时间】:2017-07-12 09:42:00
【问题描述】:

我已将工具栏集成到主活动中,现在我想更改图标 berger 的颜色和项目菜单的背景颜色:

<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent" android:layout_height="wrap_content"
    android:id="@+id/toolbar"
    android:fitsSystemWindows="true"
    android:theme="@style/toolbar"
    app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">

</android.support.v7.widget.Toolbar>

样式文件是:

<resources>

    <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
    </style>
</resources>

【问题讨论】:

标签: android android-toolbar


【解决方案1】:

试试这个:

 <?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent" 
    android:layout_height="wrap_content"
    android:id="@+id/toolbar"
    android:fitsSystemWindows="true"
    app:theme="@style/backArrowTheme"
    app:popupTheme="@style/AppTheme"
   >    
</android.support.v7.widget.Toolbar>


<style name="backArrowTheme" parent="AppTheme">
    <item name="android:textColorSecondary">Hexcode of color</item>
</style>

【讨论】:

  • 工作得很好,竖起大拇指,请问其他事情是否也可以将其应用于背景菜单项
猜你喜欢
  • 2017-07-09
  • 1970-01-01
  • 2021-03-17
  • 1970-01-01
  • 2015-03-24
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-11-20
相关资源
最近更新 更多