美文网首页
android toolbar右边更多菜单图标颜色修改

android toolbar右边更多菜单图标颜色修改

作者: 吉凶以情迁 | 来源:发表于2021-11-13 10:02 被阅读0次

以前做app都是按设计师来,现在自己设计app,好爽,material design!

                  <androidx.appcompat.widget.Toolbar
                        android:id="@+id/toolBar"
                        android:layout_width="match_parent"
                        android:layout_height="?attr/actionBarSize"
                        android:background="@color/themeColor"
                        app:navigationIcon="@drawable/ic_menu_back"
                        app:title="@string/app_name"
                        android:theme="@style/ToolbarIconColor"
                        app:titleTextColor="@android:color/white" />


    <style name="ToolbarIconColor" parent="@style/ThemeOverlay.AppCompat.Light">
        <item name="colorControlNormal">@color/white_no_night</item>
    </style>

如果不适用toolbar,那么无需修改,只需要修改全局主题Theme.MaterialComponents.Light.DarkActionBar
DarkActionBar的意思是高亮白色主题,但是actionbar是深色模式。 深色模式下文字 图标自然而然是白色了。

相关文章

网友评论

      本文标题:android toolbar右边更多菜单图标颜色修改

      本文链接:https://www.haomeiwen.com/subject/jjwazltx.html