简书链接:androidtoolbar右边更多菜单图标颜色修改
文章字数:131,阅读全文大约需要1分钟
以前做app都是按设计师来,现在自己设计app,好爽,material design!
1 2 3 4 5 6 7 8 9 10
| <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" />
|
1 2 3 4
| <style name="ToolbarIconColor" parent="@style/ThemeOverlay.AppCompat.Light"> <item name="colorControlNormal">@color/white_no_night</item> </style>
|
如果不适用toolbar,那么无需修改,只需要修改全局主题Theme.MaterialComponents.Light.DarkActionBar
DarkActionBar的意思是高亮白色主题,但是actionbar是深色模式。 深色模式下文字 图标自然而然是白色了。