在指南中安卓5.0,导航栏似乎是可定制的:http://www.google.com/design/spec/layout/struct.html#structural-system-bars http://www.google.com/design/spec/layout/structure.html#structure-system-bars
如何更改导航栏颜色?
我想使用白色风格。
Screenshots:
编辑:在我的资源中,我测试了样式:
<item name="android:navigationBarColor" tools:targetApi="21">@android:color/white</item>
但按钮是白色的。我想要与第二张图像相同的渲染器。
从API 27开始,现在可以使用导航栏的浅色样式:
<item name="android:navigationBarColor">@android:color/white</item>
<item name="android:windowLightNavigationBar">true</item>
来自文档 https://developer.android.com/reference/android/R.attr.html#windowLightNavigationBar:
windowLightNavigationBar
如果设置,导航栏将被绘制为与浅色导航栏背景兼容。
为了使其生效,窗口必须绘制系统栏
带有 windowDrawsSystemBarBackgrounds 和导航的背景
不得要求栏是半透明的
窗口半透明导航。对应设定
装饰视图上的 SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)