简体   繁体   English

如何在Android中更改屏幕底部的软导航背景和图标颜色?

[英]How to change the bottom on screen soft navigation background and icon color in android?

I want to change the background color of this soft on screen navigation from black to blue. 我想将此软屏幕导航的背景颜色从黑色更改为蓝色。 Twitter android app has done it. Twitter android应用程序已经做到了。 I did this, 我做到了

@color/colorPrimaryDark @ color / colorPrimaryDark

Before adding the navigationBarColor tag in styles.xml 在styles.xml中添加navigationBarColor标记之前

之前

After adding the navigationBarColor tag in styles.xml 在styles.xml中添加navigationBarColor标记之后

在此处输入图片说明

I cannot find a way to change the icon colors to dark. 我找不到将图标颜色更改为深色的方法。

Here is my styles.xml 这是我的styles.xml

 <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <!-- Customize your theme here. -->
        <item name="android:windowContentTransitions">true</item>
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
        <item name="android:statusBarColor">@color/colorPrimaryDark</item>
        <item name="android:windowLightStatusBar">true</item>
        <item name="android:colorEdgeEffect">@color/subtleGrey</item>
        <item name="actionButtonStyle">@style/myActionButtonStyle</item>
        <item name="android:splitMotionEvents">false</item>
        <item name="android:windowEnableSplitTouch">false</item>
        <item name="android:navigationBarColor">@color/colorPrimaryDark</item>
</style>
    <item name="android:navigationBarColor" tools:targetApi="lollipop">@color/colorPrimary
    </item>

try it 试试吧

After a while, I got this. 过了一会儿,我明白了。

    <item name="android:windowLightNavigationBar">true</item>

Adding this solved my problem! 添加这个解决了我的问题!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 底部导航图标颜色变化 - Bottom Navigation Icon color change 为什么我无法使用渐变颜色 android 更改图标颜色和文本底部导航 - Why i can't change icon color and text bottom navigation with gradient color android Android Studio - onClick 片段事务不改变底部导航菜单图标颜色 - Android Studio - onClick Fragment Transaction does not change Bottom Navigation Menu Icon Color 如何在android studio中更改导航视图中汉堡包图标的颜色 - how to change the color of the hamburger icon in the navigation view in android studio 无法更改导航抽屉图标颜色 android - Cannot change navigation drawer icon color android 如何将系统导航栏的背景颜色设置为Material 3中新的底部导航栏之一? (安卓) - How to set the background color of system navigation bar to the one of the new Bottom Navigation bar in Material 3? (Android) 如何在android导航抽屉中更改所选项目的背景颜色? - How to change the selected item's background color in android navigation drawer? Android如何在每个listvIew列表项上添加图标并更改文本颜色,背景颜色 - Android How to add icon on each listvIew list item and change the text color,Background color Android通知图标可根据状态栏颜色更改背景 - Android notification icon to change background according to status bar color 在JFrame中更改背景颜色和图标 - Change Background Color and Icon in JFrame
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM