React Native:如何在 Android 上更改最近应用的背景标题颜色? [英] React Native: how to change recent apps background title color on Android?

查看:77
本文介绍了React Native:如何在 Android 上更改最近应用的背景标题颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 react-native 更改最近应用视图中的背景标题颜色(当您按下 Android 上的概览方形按钮时).

您可以在下图中看到 Facebook 应用的背景颜色为蓝色,但我的 Bitcoin FOMO Calculator 应用具有默认的灰色.

谢谢

解决方案

1.将colors.xml创建到android/app/src/main/res/values/colors.xml中

<color name="colorPrimary">#3F51B5</color><color name="colorPrimaryDark">#303F9F</color><color name="colorAccent">#FF4081</color></资源>

2.修改android/app/src/main/res/values/styles.xml里面的styles.xml

<!-- 基本应用程序主题.--><style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"><!-- 在此处自定义您的主题.--><item name="colorPrimary">@color/colorPrimary</item><项目名称="colorPrimaryDark">@color/colorPrimaryDark</item><item name="colorAccent">@color/colorAccent</item></风格></资源>

3.关于

I would like to change the background title color in the recent apps view (when you press the Overview square button on Android) using react-native.

You can see in the image below that the Facebook app has a blue background color, but my Bitcoin FOMO Calculator app has the default gray color.

Thanks

解决方案

1.Create colors.xml into android/app/src/main/res/values/colors.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <!-- Change the color value for your need -->
    <color name="colorPrimary">#3F51B5</color>
    <color name="colorPrimaryDark">#303F9F</color>
    <color name="colorAccent">#FF4081</color>
</resources>

2.Modify the styles.xml inside android/app/src/main/res/values/styles.xml

<resources>
    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
    </style>
</resources>

3.The result and more detail about Android Style and Theme:

这篇关于React Native:如何在 Android 上更改最近应用的背景标题颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆