2 个回答

默认情况下你应该使用的是style.xml中的AppTheme主题(这个可以在AndroidManifest.xml中看出来)。假设是这样,那么你可以通过以下方法改变 drawer 按钮的颜色:

  1. 进入style.xml

  2. 增加一种继承自Widget.AppCompat.DrawerArrowToggle的style,这里叫做"DrawerArrowStyle"。在里面加上你想要的颜色,这里比如@color/colorBlue

  3. 在 style "AppTheme" 中增加一行名为 drawerArrowStyle 的这种 style。

这样一来,style 中便有如下两项:

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    ...
    <item name="drawerArrowStyle">@style/DrawerArrowStyle</item>
</style>

<style name="DrawerArrowStyle" parent="Widget.AppCompat.DrawerArrowToggle">
    <item name="color">@color/colorBlue</item>
</style>

再运行你就看到结果了。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题