且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何更改导航栏图标的颜色? (Android Studio)

更新时间:2023-01-05 19:57:26

您不能自行更改按钮的颜色. 但是,您可以尝试将navigationbarlight设置为true.应该注意的是,这仅在API级别27中可用.

You cannot change the color of the buttons yourself. However you can try to set the navigationbarlight to true. It should be noted that this is only available from API level 27.

windowLightNavigationBar 已添加到API级别27

windowLightNavigationBar added in API level 27

int windowLightNavigationBar

如果设置,将绘制导航栏以使其兼容 带有浅色导航栏背景.

If set, the navigation bar will be drawn such that it is compatible with a light navigation bar background.

要使其生效,该窗口必须绘制系统栏 windowDrawsSystemBarBackgrounds和导航的背景 不得要求bar与 windowTranslucentNavigation.对应设置 装饰视图上的SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR.

For this to take effect, the window must be drawing the system bar backgrounds with windowDrawsSystemBarBackgrounds and the navigation bar must not have been requested to be translucent with windowTranslucentNavigation. Corresponds to setting SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR on the decor view.

可能是布尔值,例如"true"或"false".

May be a boolean value, such as "true" or "false".